@vitrina/api 11.32.0 → 11.33.1

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
@@ -65665,6 +65665,8 @@ interface paths {
65665
65665
  * Export and erasure requests
65666
65666
  * @description The durable record of who asked for what, when, and what came back — including a refused erasure and the date its window closes. Requires `clinic_record:read`.
65667
65667
  *
65668
+ * An erasure’s `result.engine` is the attribution-data half: `status` `owed` → `queued` → `confirming` → `done` (or `skipped` / `failed`; `done` only once the attribution engine confirms it); `ficha` `erased` | `retained` (retained by law, marketing data erased); `marketing_blocked`; `scrubbed {outbox_rows, threads}` (Vitrina’s own copies of the marketing identifiers removed); `skipped` `no_self_contact` (the ficha has no contact of its own — a guardian is never erased for the patient) or `no_engine_profile`; `receipts[]` `{erasure_id, engine_status, completed_at}`. Say «datos de marketing eliminados» only at `done`. `engine_skipped_no_self_contact` counts the requests that skipped for lack of a contact of their own.
65669
+ *
65668
65670
  * **Connected apps:** refused with `403 CONNECTED_APP_SENSITIVE_DATA`, whatever scopes they hold — this operation carries a dato sensible (ADR 0106 §4). Only an API key or a personal token of the workspace that holds the scope reaches it.
65669
65671
  */
65670
65672
  get: {
@@ -66041,7 +66043,7 @@ interface paths {
66041
66043
  put?: never;
66042
66044
  /**
66043
66045
  * Erasure request (Ley 21.719), bounded by the retention floor
66044
- * @description INSIDE the 15-year window (Ley 20.584, Decreto 41) the request is REFUSED — with the legal reason and the date it may be executed — and the refusal is recorded; a silent refusal is as bad as a wrongful deletion. OUTSIDE it, the PII is tombstoned and the clinical rows stay for their own retention. A refusal answers 201, not a 4xx: the request was accepted and lawfully answered, and the row is the answer. Every call writes a `clinic_record_access_log` row; a call that cannot write its access event fails.
66046
+ * @description INSIDE the 15-year window (Ley 20.584, Decreto 41) the request is REFUSED — with the legal reason and the date it may be executed — and the refusal is recorded; a silent refusal is as bad as a wrongful deletion. OUTSIDE it, the PII is tombstoned and the clinical rows stay for their own retention. A refusal answers 201, not a 4xx: the request was accepted and lawfully answered, and the row is the answer. Either way the patient’s attribution/marketing data is erased too: `result.engine` starts `owed` and moves to `done` asynchronously (shape: see `GET /clinic/privacy-requests`); from then on no outcome, identity or link of that contact reaches the attribution engine again. Every call writes a `clinic_record_access_log` row; a call that cannot write its access event fails.
66045
66047
  *
66046
66048
  * **Connected apps:** refused with `403 CONNECTED_APP_SENSITIVE_DATA`, whatever scopes they hold — this operation carries a dato sensible (ADR 0106 §4). Only an API key or a personal token of the workspace that holds the scope reaches it.
66047
66049
  */
@@ -96190,12 +96192,18 @@ interface paths {
96190
96192
  cookie?: never;
96191
96193
  };
96192
96194
  /**
96193
- * One feed row’s path to its outcome
96194
- * @description The touches that led to one recorded outcome, oldest first, ending at the outcome: ad views and clicks (ad and campaign names), site visits, conversations. From the attribution engine (`source: engine`) when it credited the outcome and the delegated key may read people; otherwise Vitrina’s own record of this contact’s outcomes (`source: vitrina`) — still a path, without the ad touches, and `reason` says why (`unmatched` / `pending` / `role`). Never carries a URL, referrer, email or device. 404 when the id is not a live row of this workspace. With `sample=1` answers the sample dataset’s journey (pass the feed’s `from`/`to` when it was not the last 30 days).
96195
+ * One feed row’s journey
96196
+ * @description The journey behind one recorded outcome, oldest first: the attribution engine’s touches (the ad — its name, ad set, campaign and thumbnail — the click that landed, site visits) interleaved with the steps Vitrina recorded itself (first message, booking, attended visit, presented quote, acceptance, payments). The credited touch is `credited: true` with its `join_method`; the row itself is `current: true`. Labels are ready to render in the workspace’s vocabulary, and `stage` carries the vocabulary key.
96197
+ *
96198
+ * `scope=conversion` (default) ends at this outcome; `scope=person` is the whole person — every touch and every recorded step, across repeat visits and devices — plus `person.attended_count` («vino n veces») and `person.conversion_count`.
96199
+ *
96200
+ * Never a 5xx for the engine: when its touches cannot be shown the journey is Vitrina’s own steps (`source: vitrina`) and `reason` says why (`unmatched` / `pending` / `unavailable` / `scope`). Never carries a URL, path, referrer, device, location, email or the engine’s own person ids. 404 when the id is not a live row of this workspace. With `sample=1` answers the sample dataset’s journey (pass the feed’s `from`/`to` when it was not the last 30 days).
96195
96201
  */
96196
96202
  get: {
96197
96203
  parameters: {
96198
96204
  query?: {
96205
+ /** @description `conversion` (default): the path to THIS outcome — the touches before it and the contact’s recorded steps up to it. `person`: the whole person — every touch and every recorded step, across repeat visits and devices — plus `person` (how many times they came, how many conversions). Use it for «Ver recorrido completo». */
96206
+ scope?: "conversion" | "person";
96199
96207
  /** @description Sample mode only: the feed window the item came from (defaults to the last 30 days). Ignored for real data. */
96200
96208
  from?: string;
96201
96209
  /** @description Sample mode only — see `from`. */
@@ -96223,38 +96231,125 @@ interface paths {
96223
96231
  * "data": {
96224
96232
  * "steps": [
96225
96233
  * {
96234
+ * "stage": null,
96235
+ * "detail": "Ortodoncia invisible · Septiembre",
96236
+ * "credited": false,
96237
+ * "join_method": null,
96238
+ * "click_id_kind": null,
96239
+ * "ad": {
96240
+ * "external_id": "120211000000000101",
96241
+ * "name": "Reel · Antes y después",
96242
+ * "ad_set_name": "Mujeres 30-45 · Providencia",
96243
+ * "campaign": {
96244
+ * "external_id": "120211000000000100",
96245
+ * "name": "Ortodoncia invisible · Septiembre"
96246
+ * },
96247
+ * "creative_thumbnail_url": null
96248
+ * },
96249
+ * "value": null,
96250
+ * "current": false,
96251
+ * "id": "b2f0c1d4-1a2b-4c3d-8e4f-5a6b7c8d9e01",
96226
96252
  * "kind": "ad",
96253
+ * "origin": "engine",
96227
96254
  * "label": "Reel · Antes y después",
96228
- * "detail": "Ortodoncia invisible · Septiembre",
96229
96255
  * "at": "2026-09-19T21:10:00.000Z",
96230
96256
  * "channel": "meta"
96231
96257
  * },
96232
96258
  * {
96259
+ * "stage": null,
96260
+ * "detail": "Reel · Antes y después",
96261
+ * "credited": true,
96262
+ * "join_method": "click_id",
96263
+ * "click_id_kind": "fbclid",
96264
+ * "ad": {
96265
+ * "external_id": "120211000000000101",
96266
+ * "name": "Reel · Antes y después",
96267
+ * "ad_set_name": "Mujeres 30-45 · Providencia",
96268
+ * "campaign": {
96269
+ * "external_id": "120211000000000100",
96270
+ * "name": "Ortodoncia invisible · Septiembre"
96271
+ * },
96272
+ * "creative_thumbnail_url": null
96273
+ * },
96274
+ * "value": null,
96275
+ * "current": false,
96276
+ * "id": "b2f0c1d4-1a2b-4c3d-8e4f-5a6b7c8d9e02",
96233
96277
  * "kind": "click",
96234
- * "label": "Reel · Antes y después",
96235
- * "detail": "Ortodoncia invisible · Septiembre",
96278
+ * "origin": "engine",
96279
+ * "label": "Visita desde el anuncio",
96236
96280
  * "at": "2026-09-20T13:02:00.000Z",
96237
96281
  * "channel": "meta"
96238
96282
  * },
96239
96283
  * {
96284
+ * "stage": "lead_created",
96285
+ * "detail": "Por WhatsApp",
96286
+ * "credited": false,
96287
+ * "join_method": null,
96288
+ * "click_id_kind": null,
96289
+ * "ad": null,
96290
+ * "value": null,
96291
+ * "current": false,
96292
+ * "id": "01926f3e-1111-7b2e-9f10-3a5b7c9d0e10",
96240
96293
  * "kind": "chat",
96241
- * "label": "Conversación",
96242
- * "detail": null,
96294
+ * "origin": "vitrina",
96295
+ * "label": "Contacto nuevo",
96243
96296
  * "at": "2026-09-20T13:03:00.000Z",
96244
96297
  * "channel": "whatsapp"
96245
96298
  * },
96246
96299
  * {
96247
- * "kind": "outcome",
96248
- * "label": "Presupuesto aceptado",
96300
+ * "stage": "appointment_attended",
96301
+ * "detail": null,
96302
+ * "credited": false,
96303
+ * "join_method": null,
96304
+ * "click_id_kind": null,
96305
+ * "ad": null,
96306
+ * "value": null,
96307
+ * "current": false,
96308
+ * "id": "01926f3e-2222-7b2e-9f10-3a5b7c9d0e11",
96309
+ * "kind": "attended",
96310
+ * "origin": "vitrina",
96311
+ * "label": "Cita atendida",
96312
+ * "at": "2026-09-21T14:00:00.000Z"
96313
+ * },
96314
+ * {
96315
+ * "stage": "quote_presented",
96249
96316
  * "detail": null,
96317
+ * "credited": false,
96318
+ * "join_method": null,
96319
+ * "click_id_kind": null,
96320
+ * "ad": null,
96321
+ * "value": 1200000,
96322
+ * "current": false,
96323
+ * "id": "01926f3e-3333-7b2e-9f10-3a5b7c9d0e12",
96324
+ * "kind": "quote",
96325
+ * "origin": "vitrina",
96326
+ * "label": "Presupuesto presentado",
96327
+ * "at": "2026-09-21T15:20:00.000Z"
96328
+ * },
96329
+ * {
96330
+ * "stage": "closed_won",
96331
+ * "detail": null,
96332
+ * "credited": false,
96333
+ * "join_method": null,
96334
+ * "click_id_kind": null,
96335
+ * "ad": null,
96336
+ * "value": 1200000,
96337
+ * "current": true,
96338
+ * "id": "01926f3e-7c1a-7b2e-9f10-3a5b7c9d0e1f",
96339
+ * "kind": "accepted",
96340
+ * "origin": "vitrina",
96341
+ * "label": "Presupuesto aceptado",
96250
96342
  * "at": "2026-09-22T19:40:12.000Z"
96251
96343
  * }
96252
96344
  * ],
96253
- * "touch_count": 3,
96345
+ * "touch_count": 2,
96254
96346
  * "credited_weight": 1,
96255
96347
  * "model": "last_touch",
96256
- * "source": "engine",
96257
- * "reason": null
96348
+ * "scope": "conversion",
96349
+ * "source": "mixed",
96350
+ * "reason": null,
96351
+ * "person": null,
96352
+ * "truncated": false
96258
96353
  * }
96259
96354
  * }
96260
96355
  */
@@ -117401,6 +117496,11 @@ interface components {
117401
117496
  domain: string | null;
117402
117497
  /** @enum {string} */
117403
117498
  source: "tracker" | "health";
117499
+ /**
117500
+ * @description Where the tag sends its events: `same_origin` — a collector on the site’s own domain (the only setup Safari does not cap; visitors stay recognised across weeks); `cname` — a verified tracking subdomain (Safari still caps it); `none` — the default endpoint. `null` when it could not be read.
117501
+ * @enum {string|null}
117502
+ */
117503
+ collector: "same_origin" | "cname" | "none" | null;
117404
117504
  };
117405
117505
  AdsFeedItem: {
117406
117506
  /** Format: uuid */
@@ -117442,28 +117542,94 @@ interface components {
117442
117542
  credited_weight: number | null;
117443
117543
  touch_count: number | null;
117444
117544
  };
117545
+ AdsJourneyStepAd: {
117546
+ /** @description The ad’s PLATFORM id; `null` when only the campaign is known. */
117547
+ external_id: string | null;
117548
+ name: string | null;
117549
+ ad_set_name: string | null;
117550
+ campaign: {
117551
+ /** @description The campaign’s PLATFORM id. */
117552
+ external_id: string | null;
117553
+ name: string | null;
117554
+ } | null;
117555
+ /** @description The ad’s thumbnail when known; render the megaphone glyph for `null`. */
117556
+ creative_thumbnail_url: string | null;
117557
+ } | null;
117558
+ AdsJourneyStep: {
117559
+ /** @description Stable key for the step. For a step recorded by Vitrina it is the feed item id (`GET /ads/feed` `data[].id`). */
117560
+ id: string;
117561
+ /**
117562
+ * @description Touches: `ad` (an off-site ad touch — an ad click or a click-to-WhatsApp referral), `click` (a visit that landed from an ad click, or a tracked link click), `visit` (a site visit), `chat` (the first message, or a social interaction). Recorded steps, in funnel order: `chat` (first message), `booking`, `attended`, `quote`, `accepted` (a presupuesto accepted / a sale closed), `payment`; `outcome` for anything else.
117563
+ * @enum {string}
117564
+ */
117565
+ kind: "ad" | "click" | "visit" | "chat" | "outcome" | "booking" | "attended" | "quote" | "accepted" | "payment";
117566
+ /**
117567
+ * @description `engine` = a touch the attribution engine observed; `vitrina` = a step Vitrina recorded itself.
117568
+ * @enum {string}
117569
+ */
117570
+ origin: "engine" | "vitrina";
117571
+ /**
117572
+ * @description The outcome stage of a recorded step (the vocabulary key); `null` on a touch. `first_payment` is a plan’s first payment (shown once, in place of that payment’s `payment_received`).
117573
+ * @enum {string|null}
117574
+ */
117575
+ stage: "lead_created" | "appointment_booked" | "appointment_attended" | "quote_presented" | "closed_won" | "payment_received" | "first_payment" | null;
117576
+ /** @description Ready to render, in the workspace’s own vocabulary. */
117577
+ label: string;
117578
+ detail: string | null;
117579
+ /** @description When it happened (ISO 8601). */
117580
+ at: string;
117581
+ /** @description A channel word: `meta`, `google`, `instagram`, `whatsapp`, `web`, `email`, `phone`, … Never a URL or a domain. */
117582
+ channel?: string;
117583
+ /** @description The touch the outcome was credited to, under `model`. */
117584
+ credited: boolean;
117585
+ /**
117586
+ * @description How the touch is tied to this person, when proven: `ctwa_referral` (the click-to-WhatsApp / Instagram ad referral), `click_id` (the ad click id the outcome carried), `link_token` (a link Vitrina sent), `anonymous_id` (the same browser). `null` on recorded steps.
117587
+ * @enum {string|null}
117588
+ */
117589
+ join_method: "ctwa_referral" | "click_id" | "link_token" | "anonymous_id" | null;
117590
+ /** @description The KIND of ad click id the touch carried (`fbclid`, `gclid`, `gbraid`, `wbraid`, `ctwa_clid`, …) — never its value. */
117591
+ click_id_kind: string | null;
117592
+ ad: components["schemas"]["AdsJourneyStepAd"];
117593
+ /** @description CLP on money steps (`quote`, `accepted`, `payment`); `null` otherwise. */
117594
+ value: number | null;
117595
+ /** @description This step is the feed row the journey was opened from. */
117596
+ current: boolean;
117597
+ };
117598
+ /** @description Set exactly when `scope` is `person`. */
117599
+ AdsJourneyPerson: {
117600
+ /** @description Every conversion of the person, whole history — each stage counts (a lead, a booking and a payment are three). */
117601
+ conversion_count: number;
117602
+ /** @description «Veces que vino»: the attended entry citas recorded for this contact («Cita atendida» — distinct `appointment_attended` steps). Clinics only for now: other workspaces record no attended stage, so it is `0` there. Never inferred from bookings. Show a «vino n veces» badge from 2 on. */
117603
+ attended_count: number;
117604
+ /** @description Marketing touches, whole history. */
117605
+ touch_count: number;
117606
+ first_touch_at: string | null;
117607
+ last_touch_at: string | null;
117608
+ } | null;
117445
117609
  AdsJourney: {
117446
- steps: {
117447
- /** @enum {string} */
117448
- kind: "ad" | "click" | "visit" | "chat" | "outcome";
117449
- label: string;
117450
- detail: string | null;
117451
- at: string;
117452
- channel?: string;
117453
- }[];
117610
+ /** @description Oldest first; at the same instant a touch precedes the step it led to, then by `id` — the same order on every read. */
117611
+ steps: components["schemas"]["AdsJourneyStep"][];
117454
117612
  touch_count: number;
117455
117613
  credited_weight: number | null;
117456
117614
  model: string;
117457
117615
  /**
117458
- * @description `engine` = the attribution engine’s touches; `vitrina` = only the outcomes Vitrina recorded for this contact (the delegated key cannot read people, or the engine has no path for it yet).
117616
+ * @description The scope the journey was read at (see the `scope` parameter).
117617
+ * @enum {string}
117618
+ */
117619
+ scope: "conversion" | "person";
117620
+ /**
117621
+ * @description `mixed` = the attribution engine’s touches interleaved with the steps Vitrina recorded; `engine` = touches only; `vitrina` = only the steps Vitrina recorded (see `reason`).
117459
117622
  * @enum {string}
117460
117623
  */
117461
- source: "engine" | "vitrina";
117624
+ source: "engine" | "mixed" | "vitrina";
117462
117625
  /**
117463
- * @description Why the ad path is absent, beside `source: vitrina` (`null` exactly when `source` is `engine`): `unmatched` — the outcome was not matched to an ad, there is no ad path to show; `pending` — matched, but the ad credit or the path is not available yet (retry later); `role` — this workspace’s access does not include reading a person’s path.
117626
+ * @description Why the ad path is absent or incomplete — set whenever `source` is `vitrina`, and `unavailable` also when the touches could only be read in part within the time budget: `unmatched` — no touch leads to this outcome / person (arrived without an ad or a visit that can be traced); `pending` — not readable yet (retry later); `unavailable` — the attribution engine could not be read now; `scope` — the workspace’s attribution access refused the read. `role` is retired and never sent.
117464
117627
  * @enum {string|null}
117465
117628
  */
117466
- reason: "role" | "unmatched" | "pending" | null;
117629
+ reason: "role" | "unmatched" | "pending" | "unavailable" | "scope" | null;
117630
+ person: components["schemas"]["AdsJourneyPerson"];
117631
+ /** @description `true` when the OLDEST touches of a long history were left out: `steps` is the newest window (the credited touch and the latest steps are always in it). Not a degraded state — `person` carries the whole-history totals. Show «mostrando lo más reciente». */
117632
+ truncated: boolean;
117467
117633
  };
117468
117634
  };
117469
117635
  responses: never;
package/dist/index.d.ts CHANGED
@@ -65665,6 +65665,8 @@ interface paths {
65665
65665
  * Export and erasure requests
65666
65666
  * @description The durable record of who asked for what, when, and what came back — including a refused erasure and the date its window closes. Requires `clinic_record:read`.
65667
65667
  *
65668
+ * An erasure’s `result.engine` is the attribution-data half: `status` `owed` → `queued` → `confirming` → `done` (or `skipped` / `failed`; `done` only once the attribution engine confirms it); `ficha` `erased` | `retained` (retained by law, marketing data erased); `marketing_blocked`; `scrubbed {outbox_rows, threads}` (Vitrina’s own copies of the marketing identifiers removed); `skipped` `no_self_contact` (the ficha has no contact of its own — a guardian is never erased for the patient) or `no_engine_profile`; `receipts[]` `{erasure_id, engine_status, completed_at}`. Say «datos de marketing eliminados» only at `done`. `engine_skipped_no_self_contact` counts the requests that skipped for lack of a contact of their own.
65669
+ *
65668
65670
  * **Connected apps:** refused with `403 CONNECTED_APP_SENSITIVE_DATA`, whatever scopes they hold — this operation carries a dato sensible (ADR 0106 §4). Only an API key or a personal token of the workspace that holds the scope reaches it.
65669
65671
  */
65670
65672
  get: {
@@ -66041,7 +66043,7 @@ interface paths {
66041
66043
  put?: never;
66042
66044
  /**
66043
66045
  * Erasure request (Ley 21.719), bounded by the retention floor
66044
- * @description INSIDE the 15-year window (Ley 20.584, Decreto 41) the request is REFUSED — with the legal reason and the date it may be executed — and the refusal is recorded; a silent refusal is as bad as a wrongful deletion. OUTSIDE it, the PII is tombstoned and the clinical rows stay for their own retention. A refusal answers 201, not a 4xx: the request was accepted and lawfully answered, and the row is the answer. Every call writes a `clinic_record_access_log` row; a call that cannot write its access event fails.
66046
+ * @description INSIDE the 15-year window (Ley 20.584, Decreto 41) the request is REFUSED — with the legal reason and the date it may be executed — and the refusal is recorded; a silent refusal is as bad as a wrongful deletion. OUTSIDE it, the PII is tombstoned and the clinical rows stay for their own retention. A refusal answers 201, not a 4xx: the request was accepted and lawfully answered, and the row is the answer. Either way the patient’s attribution/marketing data is erased too: `result.engine` starts `owed` and moves to `done` asynchronously (shape: see `GET /clinic/privacy-requests`); from then on no outcome, identity or link of that contact reaches the attribution engine again. Every call writes a `clinic_record_access_log` row; a call that cannot write its access event fails.
66045
66047
  *
66046
66048
  * **Connected apps:** refused with `403 CONNECTED_APP_SENSITIVE_DATA`, whatever scopes they hold — this operation carries a dato sensible (ADR 0106 §4). Only an API key or a personal token of the workspace that holds the scope reaches it.
66047
66049
  */
@@ -96190,12 +96192,18 @@ interface paths {
96190
96192
  cookie?: never;
96191
96193
  };
96192
96194
  /**
96193
- * One feed row’s path to its outcome
96194
- * @description The touches that led to one recorded outcome, oldest first, ending at the outcome: ad views and clicks (ad and campaign names), site visits, conversations. From the attribution engine (`source: engine`) when it credited the outcome and the delegated key may read people; otherwise Vitrina’s own record of this contact’s outcomes (`source: vitrina`) — still a path, without the ad touches, and `reason` says why (`unmatched` / `pending` / `role`). Never carries a URL, referrer, email or device. 404 when the id is not a live row of this workspace. With `sample=1` answers the sample dataset’s journey (pass the feed’s `from`/`to` when it was not the last 30 days).
96195
+ * One feed row’s journey
96196
+ * @description The journey behind one recorded outcome, oldest first: the attribution engine’s touches (the ad — its name, ad set, campaign and thumbnail — the click that landed, site visits) interleaved with the steps Vitrina recorded itself (first message, booking, attended visit, presented quote, acceptance, payments). The credited touch is `credited: true` with its `join_method`; the row itself is `current: true`. Labels are ready to render in the workspace’s vocabulary, and `stage` carries the vocabulary key.
96197
+ *
96198
+ * `scope=conversion` (default) ends at this outcome; `scope=person` is the whole person — every touch and every recorded step, across repeat visits and devices — plus `person.attended_count` («vino n veces») and `person.conversion_count`.
96199
+ *
96200
+ * Never a 5xx for the engine: when its touches cannot be shown the journey is Vitrina’s own steps (`source: vitrina`) and `reason` says why (`unmatched` / `pending` / `unavailable` / `scope`). Never carries a URL, path, referrer, device, location, email or the engine’s own person ids. 404 when the id is not a live row of this workspace. With `sample=1` answers the sample dataset’s journey (pass the feed’s `from`/`to` when it was not the last 30 days).
96195
96201
  */
96196
96202
  get: {
96197
96203
  parameters: {
96198
96204
  query?: {
96205
+ /** @description `conversion` (default): the path to THIS outcome — the touches before it and the contact’s recorded steps up to it. `person`: the whole person — every touch and every recorded step, across repeat visits and devices — plus `person` (how many times they came, how many conversions). Use it for «Ver recorrido completo». */
96206
+ scope?: "conversion" | "person";
96199
96207
  /** @description Sample mode only: the feed window the item came from (defaults to the last 30 days). Ignored for real data. */
96200
96208
  from?: string;
96201
96209
  /** @description Sample mode only — see `from`. */
@@ -96223,38 +96231,125 @@ interface paths {
96223
96231
  * "data": {
96224
96232
  * "steps": [
96225
96233
  * {
96234
+ * "stage": null,
96235
+ * "detail": "Ortodoncia invisible · Septiembre",
96236
+ * "credited": false,
96237
+ * "join_method": null,
96238
+ * "click_id_kind": null,
96239
+ * "ad": {
96240
+ * "external_id": "120211000000000101",
96241
+ * "name": "Reel · Antes y después",
96242
+ * "ad_set_name": "Mujeres 30-45 · Providencia",
96243
+ * "campaign": {
96244
+ * "external_id": "120211000000000100",
96245
+ * "name": "Ortodoncia invisible · Septiembre"
96246
+ * },
96247
+ * "creative_thumbnail_url": null
96248
+ * },
96249
+ * "value": null,
96250
+ * "current": false,
96251
+ * "id": "b2f0c1d4-1a2b-4c3d-8e4f-5a6b7c8d9e01",
96226
96252
  * "kind": "ad",
96253
+ * "origin": "engine",
96227
96254
  * "label": "Reel · Antes y después",
96228
- * "detail": "Ortodoncia invisible · Septiembre",
96229
96255
  * "at": "2026-09-19T21:10:00.000Z",
96230
96256
  * "channel": "meta"
96231
96257
  * },
96232
96258
  * {
96259
+ * "stage": null,
96260
+ * "detail": "Reel · Antes y después",
96261
+ * "credited": true,
96262
+ * "join_method": "click_id",
96263
+ * "click_id_kind": "fbclid",
96264
+ * "ad": {
96265
+ * "external_id": "120211000000000101",
96266
+ * "name": "Reel · Antes y después",
96267
+ * "ad_set_name": "Mujeres 30-45 · Providencia",
96268
+ * "campaign": {
96269
+ * "external_id": "120211000000000100",
96270
+ * "name": "Ortodoncia invisible · Septiembre"
96271
+ * },
96272
+ * "creative_thumbnail_url": null
96273
+ * },
96274
+ * "value": null,
96275
+ * "current": false,
96276
+ * "id": "b2f0c1d4-1a2b-4c3d-8e4f-5a6b7c8d9e02",
96233
96277
  * "kind": "click",
96234
- * "label": "Reel · Antes y después",
96235
- * "detail": "Ortodoncia invisible · Septiembre",
96278
+ * "origin": "engine",
96279
+ * "label": "Visita desde el anuncio",
96236
96280
  * "at": "2026-09-20T13:02:00.000Z",
96237
96281
  * "channel": "meta"
96238
96282
  * },
96239
96283
  * {
96284
+ * "stage": "lead_created",
96285
+ * "detail": "Por WhatsApp",
96286
+ * "credited": false,
96287
+ * "join_method": null,
96288
+ * "click_id_kind": null,
96289
+ * "ad": null,
96290
+ * "value": null,
96291
+ * "current": false,
96292
+ * "id": "01926f3e-1111-7b2e-9f10-3a5b7c9d0e10",
96240
96293
  * "kind": "chat",
96241
- * "label": "Conversación",
96242
- * "detail": null,
96294
+ * "origin": "vitrina",
96295
+ * "label": "Contacto nuevo",
96243
96296
  * "at": "2026-09-20T13:03:00.000Z",
96244
96297
  * "channel": "whatsapp"
96245
96298
  * },
96246
96299
  * {
96247
- * "kind": "outcome",
96248
- * "label": "Presupuesto aceptado",
96300
+ * "stage": "appointment_attended",
96301
+ * "detail": null,
96302
+ * "credited": false,
96303
+ * "join_method": null,
96304
+ * "click_id_kind": null,
96305
+ * "ad": null,
96306
+ * "value": null,
96307
+ * "current": false,
96308
+ * "id": "01926f3e-2222-7b2e-9f10-3a5b7c9d0e11",
96309
+ * "kind": "attended",
96310
+ * "origin": "vitrina",
96311
+ * "label": "Cita atendida",
96312
+ * "at": "2026-09-21T14:00:00.000Z"
96313
+ * },
96314
+ * {
96315
+ * "stage": "quote_presented",
96249
96316
  * "detail": null,
96317
+ * "credited": false,
96318
+ * "join_method": null,
96319
+ * "click_id_kind": null,
96320
+ * "ad": null,
96321
+ * "value": 1200000,
96322
+ * "current": false,
96323
+ * "id": "01926f3e-3333-7b2e-9f10-3a5b7c9d0e12",
96324
+ * "kind": "quote",
96325
+ * "origin": "vitrina",
96326
+ * "label": "Presupuesto presentado",
96327
+ * "at": "2026-09-21T15:20:00.000Z"
96328
+ * },
96329
+ * {
96330
+ * "stage": "closed_won",
96331
+ * "detail": null,
96332
+ * "credited": false,
96333
+ * "join_method": null,
96334
+ * "click_id_kind": null,
96335
+ * "ad": null,
96336
+ * "value": 1200000,
96337
+ * "current": true,
96338
+ * "id": "01926f3e-7c1a-7b2e-9f10-3a5b7c9d0e1f",
96339
+ * "kind": "accepted",
96340
+ * "origin": "vitrina",
96341
+ * "label": "Presupuesto aceptado",
96250
96342
  * "at": "2026-09-22T19:40:12.000Z"
96251
96343
  * }
96252
96344
  * ],
96253
- * "touch_count": 3,
96345
+ * "touch_count": 2,
96254
96346
  * "credited_weight": 1,
96255
96347
  * "model": "last_touch",
96256
- * "source": "engine",
96257
- * "reason": null
96348
+ * "scope": "conversion",
96349
+ * "source": "mixed",
96350
+ * "reason": null,
96351
+ * "person": null,
96352
+ * "truncated": false
96258
96353
  * }
96259
96354
  * }
96260
96355
  */
@@ -117401,6 +117496,11 @@ interface components {
117401
117496
  domain: string | null;
117402
117497
  /** @enum {string} */
117403
117498
  source: "tracker" | "health";
117499
+ /**
117500
+ * @description Where the tag sends its events: `same_origin` — a collector on the site’s own domain (the only setup Safari does not cap; visitors stay recognised across weeks); `cname` — a verified tracking subdomain (Safari still caps it); `none` — the default endpoint. `null` when it could not be read.
117501
+ * @enum {string|null}
117502
+ */
117503
+ collector: "same_origin" | "cname" | "none" | null;
117404
117504
  };
117405
117505
  AdsFeedItem: {
117406
117506
  /** Format: uuid */
@@ -117442,28 +117542,94 @@ interface components {
117442
117542
  credited_weight: number | null;
117443
117543
  touch_count: number | null;
117444
117544
  };
117545
+ AdsJourneyStepAd: {
117546
+ /** @description The ad’s PLATFORM id; `null` when only the campaign is known. */
117547
+ external_id: string | null;
117548
+ name: string | null;
117549
+ ad_set_name: string | null;
117550
+ campaign: {
117551
+ /** @description The campaign’s PLATFORM id. */
117552
+ external_id: string | null;
117553
+ name: string | null;
117554
+ } | null;
117555
+ /** @description The ad’s thumbnail when known; render the megaphone glyph for `null`. */
117556
+ creative_thumbnail_url: string | null;
117557
+ } | null;
117558
+ AdsJourneyStep: {
117559
+ /** @description Stable key for the step. For a step recorded by Vitrina it is the feed item id (`GET /ads/feed` `data[].id`). */
117560
+ id: string;
117561
+ /**
117562
+ * @description Touches: `ad` (an off-site ad touch — an ad click or a click-to-WhatsApp referral), `click` (a visit that landed from an ad click, or a tracked link click), `visit` (a site visit), `chat` (the first message, or a social interaction). Recorded steps, in funnel order: `chat` (first message), `booking`, `attended`, `quote`, `accepted` (a presupuesto accepted / a sale closed), `payment`; `outcome` for anything else.
117563
+ * @enum {string}
117564
+ */
117565
+ kind: "ad" | "click" | "visit" | "chat" | "outcome" | "booking" | "attended" | "quote" | "accepted" | "payment";
117566
+ /**
117567
+ * @description `engine` = a touch the attribution engine observed; `vitrina` = a step Vitrina recorded itself.
117568
+ * @enum {string}
117569
+ */
117570
+ origin: "engine" | "vitrina";
117571
+ /**
117572
+ * @description The outcome stage of a recorded step (the vocabulary key); `null` on a touch. `first_payment` is a plan’s first payment (shown once, in place of that payment’s `payment_received`).
117573
+ * @enum {string|null}
117574
+ */
117575
+ stage: "lead_created" | "appointment_booked" | "appointment_attended" | "quote_presented" | "closed_won" | "payment_received" | "first_payment" | null;
117576
+ /** @description Ready to render, in the workspace’s own vocabulary. */
117577
+ label: string;
117578
+ detail: string | null;
117579
+ /** @description When it happened (ISO 8601). */
117580
+ at: string;
117581
+ /** @description A channel word: `meta`, `google`, `instagram`, `whatsapp`, `web`, `email`, `phone`, … Never a URL or a domain. */
117582
+ channel?: string;
117583
+ /** @description The touch the outcome was credited to, under `model`. */
117584
+ credited: boolean;
117585
+ /**
117586
+ * @description How the touch is tied to this person, when proven: `ctwa_referral` (the click-to-WhatsApp / Instagram ad referral), `click_id` (the ad click id the outcome carried), `link_token` (a link Vitrina sent), `anonymous_id` (the same browser). `null` on recorded steps.
117587
+ * @enum {string|null}
117588
+ */
117589
+ join_method: "ctwa_referral" | "click_id" | "link_token" | "anonymous_id" | null;
117590
+ /** @description The KIND of ad click id the touch carried (`fbclid`, `gclid`, `gbraid`, `wbraid`, `ctwa_clid`, …) — never its value. */
117591
+ click_id_kind: string | null;
117592
+ ad: components["schemas"]["AdsJourneyStepAd"];
117593
+ /** @description CLP on money steps (`quote`, `accepted`, `payment`); `null` otherwise. */
117594
+ value: number | null;
117595
+ /** @description This step is the feed row the journey was opened from. */
117596
+ current: boolean;
117597
+ };
117598
+ /** @description Set exactly when `scope` is `person`. */
117599
+ AdsJourneyPerson: {
117600
+ /** @description Every conversion of the person, whole history — each stage counts (a lead, a booking and a payment are three). */
117601
+ conversion_count: number;
117602
+ /** @description «Veces que vino»: the attended entry citas recorded for this contact («Cita atendida» — distinct `appointment_attended` steps). Clinics only for now: other workspaces record no attended stage, so it is `0` there. Never inferred from bookings. Show a «vino n veces» badge from 2 on. */
117603
+ attended_count: number;
117604
+ /** @description Marketing touches, whole history. */
117605
+ touch_count: number;
117606
+ first_touch_at: string | null;
117607
+ last_touch_at: string | null;
117608
+ } | null;
117445
117609
  AdsJourney: {
117446
- steps: {
117447
- /** @enum {string} */
117448
- kind: "ad" | "click" | "visit" | "chat" | "outcome";
117449
- label: string;
117450
- detail: string | null;
117451
- at: string;
117452
- channel?: string;
117453
- }[];
117610
+ /** @description Oldest first; at the same instant a touch precedes the step it led to, then by `id` — the same order on every read. */
117611
+ steps: components["schemas"]["AdsJourneyStep"][];
117454
117612
  touch_count: number;
117455
117613
  credited_weight: number | null;
117456
117614
  model: string;
117457
117615
  /**
117458
- * @description `engine` = the attribution engine’s touches; `vitrina` = only the outcomes Vitrina recorded for this contact (the delegated key cannot read people, or the engine has no path for it yet).
117616
+ * @description The scope the journey was read at (see the `scope` parameter).
117617
+ * @enum {string}
117618
+ */
117619
+ scope: "conversion" | "person";
117620
+ /**
117621
+ * @description `mixed` = the attribution engine’s touches interleaved with the steps Vitrina recorded; `engine` = touches only; `vitrina` = only the steps Vitrina recorded (see `reason`).
117459
117622
  * @enum {string}
117460
117623
  */
117461
- source: "engine" | "vitrina";
117624
+ source: "engine" | "mixed" | "vitrina";
117462
117625
  /**
117463
- * @description Why the ad path is absent, beside `source: vitrina` (`null` exactly when `source` is `engine`): `unmatched` — the outcome was not matched to an ad, there is no ad path to show; `pending` — matched, but the ad credit or the path is not available yet (retry later); `role` — this workspace’s access does not include reading a person’s path.
117626
+ * @description Why the ad path is absent or incomplete — set whenever `source` is `vitrina`, and `unavailable` also when the touches could only be read in part within the time budget: `unmatched` — no touch leads to this outcome / person (arrived without an ad or a visit that can be traced); `pending` — not readable yet (retry later); `unavailable` — the attribution engine could not be read now; `scope` — the workspace’s attribution access refused the read. `role` is retired and never sent.
117464
117627
  * @enum {string|null}
117465
117628
  */
117466
- reason: "role" | "unmatched" | "pending" | null;
117629
+ reason: "role" | "unmatched" | "pending" | "unavailable" | "scope" | null;
117630
+ person: components["schemas"]["AdsJourneyPerson"];
117631
+ /** @description `true` when the OLDEST touches of a long history were left out: `steps` is the newest window (the credited touch and the latest steps are always in it). Not a degraded state — `person` carries the whole-history totals. Show «mostrando lo más reciente». */
117632
+ truncated: boolean;
117467
117633
  };
117468
117634
  };
117469
117635
  responses: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrina/api",
3
- "version": "11.32.0",
3
+ "version": "11.33.1",
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",