@vitrina/api 14.3.0 → 14.3.2
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 +109 -21
- package/dist/index.d.ts +109 -21
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -142778,9 +142778,10 @@ interface paths {
|
|
|
142778
142778
|
* @description WHICH count to list — each is read from the very read the count is folded from, so `count` equals the number the screen shows:
|
|
142779
142779
|
* · `paid_patients` / `arrived_patients` / `returned_patients` — `patient_return.patients` / `.arrived_patients` / `.returned_patients` of `/ads/overview` (no scope), of a `/ads/campaigns` row (`campaign_id`), of an ad (`ad_id`), or «Anuncios aún sin campaña conocida» (`unplaced=1`).
|
|
142780
142780
|
* · `funnel_<step>` — `/ads/funnel` `steps[<step>].ads` = `/ads/stages` M1 `m1.conversations` (`funnel_contacted`), M2 `m2.booked` / `m2.attended`, M3 `m3.quote_presented` / `m3.accepted` / `m3.paid`. No scope.
|
|
142781
|
+
* · `new_people[_booked|_paid]`, `returned_people[_booked]` — `/ads/stages` `m2.new_people` (D93): `people` / `booked` / `paid` and `returned.people` / `returned.booked`, over that block’s own `window` (the read’s `window`). No scope.
|
|
142781
142782
|
* · `conversations[_replied|_booked|_attended|_closed]` — the conversations ads opened (one row per CONVERSATION), all ads, one campaign (`campaign_id`, through the ad → campaign map as `/ads/campaigns` counts them) or one ad (`ad_id`).
|
|
142782
142783
|
*/
|
|
142783
|
-
metric: "paid_patients" | "arrived_patients" | "returned_patients" | "funnel_contacted" | "funnel_booked" | "funnel_attended" | "funnel_quote_presented" | "funnel_accepted" | "funnel_paid" | "conversations" | "conversations_replied" | "conversations_booked" | "conversations_attended" | "conversations_closed";
|
|
142784
|
+
metric: "paid_patients" | "arrived_patients" | "returned_patients" | "funnel_contacted" | "funnel_booked" | "funnel_attended" | "funnel_quote_presented" | "funnel_accepted" | "funnel_paid" | "new_people" | "new_people_booked" | "new_people_paid" | "returned_people" | "returned_people_booked" | "conversations" | "conversations_replied" | "conversations_booked" | "conversations_attended" | "conversations_closed";
|
|
142784
142785
|
/** @description A campaign’s PLATFORM id (`/ads/campaigns` `campaign_external_id`). Patient-return and conversation metrics only. */
|
|
142785
142786
|
campaign_id?: string;
|
|
142786
142787
|
/** @description An ad’s PLATFORM id. Patient-return and conversation metrics only. */
|
|
@@ -143703,7 +143704,13 @@ interface paths {
|
|
|
143703
143704
|
* "booked_conversations": 45,
|
|
143704
143705
|
* "ai_bookings": 54,
|
|
143705
143706
|
* "rate_pct": 7.7,
|
|
143706
|
-
* "team_helped": 60
|
|
143707
|
+
* "team_helped": 60,
|
|
143708
|
+
* "existing": {
|
|
143709
|
+
* "conversations": 214,
|
|
143710
|
+
* "booked_conversations": 38,
|
|
143711
|
+
* "ai_bookings": 41
|
|
143712
|
+
* },
|
|
143713
|
+
* "cancelled": 6
|
|
143707
143714
|
* },
|
|
143708
143715
|
* "from_ads": {
|
|
143709
143716
|
* "conversations": 461,
|
|
@@ -143789,11 +143796,11 @@ interface paths {
|
|
|
143789
143796
|
first_ai_booked_on: string | null;
|
|
143790
143797
|
timezone: string;
|
|
143791
143798
|
min_conversations: number;
|
|
143792
|
-
/** @description The same figure as `conversation_rate` on `GET /clinic/insights/resultados` for the same days. */
|
|
143799
|
+
/** @description The same figure as `conversation_rate` on `GET /clinic/insights/resultados` for the same days. NEW PEOPLE ONLY (D94): conversations of people who had written before the window are counted in `existing`, never in the rate — nor in `from_ads`, `without_ad`, `by_campaign`, `by_ad`, `by_hour`. */
|
|
143793
143800
|
overall: {
|
|
143794
|
-
/** @description Conversations Vitrina answered ALONE: the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143801
|
+
/** @description Conversations Vitrina answered ALONE with NEW people (they had not written before the window): the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143795
143802
|
conversations: number;
|
|
143796
|
-
/** @description Of `conversations`, those where the agent booked at least one cita inside the window. */
|
|
143803
|
+
/** @description Of `conversations`, those where the agent booked at least one cita inside the window (anuladas excluded). */
|
|
143797
143804
|
booked_conversations: number;
|
|
143798
143805
|
/** @description Citas the agent booked in those conversations (≥ `booked_conversations`). */
|
|
143799
143806
|
ai_bookings: number;
|
|
@@ -143801,12 +143808,23 @@ interface paths {
|
|
|
143801
143808
|
rate_pct: number | null;
|
|
143802
143809
|
/** @description Conversations the AI answered where a team member wrote first — excluded. */
|
|
143803
143810
|
team_helped: number;
|
|
143811
|
+
/** @description People who had written before the window (D94): OUTSIDE the rate — its headline counts new people only — and shown on their own line. */
|
|
143812
|
+
existing: {
|
|
143813
|
+
/** @description Conversations Vitrina answered alone with people who had written to the business BEFORE the window (patients’ follow-ups, changes of hour, earlier leads). */
|
|
143814
|
+
conversations: number;
|
|
143815
|
+
/** @description Of them, those where the agent booked at least one cita (anuladas excluded). */
|
|
143816
|
+
booked_conversations: number;
|
|
143817
|
+
/** @description Citas the agent booked in them. */
|
|
143818
|
+
ai_bookings: number;
|
|
143819
|
+
};
|
|
143820
|
+
/** @description Citas the agent booked for new people in the window that were then anuladas — never in `ai_bookings`. */
|
|
143821
|
+
cancelled: number;
|
|
143804
143822
|
} | null;
|
|
143805
143823
|
/** @description Conversations a Meta ad opened (its `ad_referral`). */
|
|
143806
143824
|
from_ads: {
|
|
143807
|
-
/** @description Conversations Vitrina answered ALONE: the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143825
|
+
/** @description Conversations Vitrina answered ALONE with NEW people (they had not written before the window): the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143808
143826
|
conversations: number;
|
|
143809
|
-
/** @description Of `conversations`, those where the agent booked at least one cita inside the window. */
|
|
143827
|
+
/** @description Of `conversations`, those where the agent booked at least one cita inside the window (anuladas excluded). */
|
|
143810
143828
|
booked_conversations: number;
|
|
143811
143829
|
/** @description Citas the agent booked in those conversations (≥ `booked_conversations`). */
|
|
143812
143830
|
ai_bookings: number;
|
|
@@ -143814,9 +143832,9 @@ interface paths {
|
|
|
143814
143832
|
rate_pct: number | null;
|
|
143815
143833
|
} | null;
|
|
143816
143834
|
without_ad: {
|
|
143817
|
-
/** @description Conversations Vitrina answered ALONE: the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143835
|
+
/** @description Conversations Vitrina answered ALONE with NEW people (they had not written before the window): the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143818
143836
|
conversations: number;
|
|
143819
|
-
/** @description Of `conversations`, those where the agent booked at least one cita inside the window. */
|
|
143837
|
+
/** @description Of `conversations`, those where the agent booked at least one cita inside the window (anuladas excluded). */
|
|
143820
143838
|
booked_conversations: number;
|
|
143821
143839
|
/** @description Citas the agent booked in those conversations (≥ `booked_conversations`). */
|
|
143822
143840
|
ai_bookings: number;
|
|
@@ -143833,9 +143851,9 @@ interface paths {
|
|
|
143833
143851
|
/** @description Meta's campaign id (= `/ads/campaigns` rows). */
|
|
143834
143852
|
campaign_external_id: string;
|
|
143835
143853
|
campaign_name: string | null;
|
|
143836
|
-
/** @description Conversations Vitrina answered ALONE: the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143854
|
+
/** @description Conversations Vitrina answered ALONE with NEW people (they had not written before the window): the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143837
143855
|
conversations: number;
|
|
143838
|
-
/** @description Of `conversations`, those where the agent booked at least one cita inside the window. */
|
|
143856
|
+
/** @description Of `conversations`, those where the agent booked at least one cita inside the window (anuladas excluded). */
|
|
143839
143857
|
booked_conversations: number;
|
|
143840
143858
|
/** @description Citas the agent booked in those conversations (≥ `booked_conversations`). */
|
|
143841
143859
|
ai_bookings: number;
|
|
@@ -143850,9 +143868,9 @@ interface paths {
|
|
|
143850
143868
|
/** @description Meta's ad id (= `/ads/creatives` rows). */
|
|
143851
143869
|
ad_external_id: string;
|
|
143852
143870
|
campaign_external_id: string | null;
|
|
143853
|
-
/** @description Conversations Vitrina answered ALONE: the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143871
|
+
/** @description Conversations Vitrina answered ALONE with NEW people (they had not written before the window): the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143854
143872
|
conversations: number;
|
|
143855
|
-
/** @description Of `conversations`, those where the agent booked at least one cita inside the window. */
|
|
143873
|
+
/** @description Of `conversations`, those where the agent booked at least one cita inside the window (anuladas excluded). */
|
|
143856
143874
|
booked_conversations: number;
|
|
143857
143875
|
/** @description Citas the agent booked in those conversations (≥ `booked_conversations`). */
|
|
143858
143876
|
ai_bookings: number;
|
|
@@ -143864,9 +143882,9 @@ interface paths {
|
|
|
143864
143882
|
/** @description 24 rows, by the hour (in `timezone`) of the person's first message in the window. */
|
|
143865
143883
|
by_hour: {
|
|
143866
143884
|
hour: number;
|
|
143867
|
-
/** @description Conversations Vitrina answered ALONE: the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143885
|
+
/** @description Conversations Vitrina answered ALONE with NEW people (they had not written before the window): the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143868
143886
|
conversations: number;
|
|
143869
|
-
/** @description Of `conversations`, those where the agent booked at least one cita inside the window. */
|
|
143887
|
+
/** @description Of `conversations`, those where the agent booked at least one cita inside the window (anuladas excluded). */
|
|
143870
143888
|
booked_conversations: number;
|
|
143871
143889
|
/** @description Citas the agent booked in those conversations (≥ `booked_conversations`). */
|
|
143872
143890
|
ai_bookings: number;
|
|
@@ -144906,7 +144924,28 @@ interface paths {
|
|
|
144906
144924
|
* "booked": 24,
|
|
144907
144925
|
* "attended": 15,
|
|
144908
144926
|
* "booked_rate": 0.112,
|
|
144909
|
-
* "attended_rate": 0.625
|
|
144927
|
+
* "attended_rate": 0.625,
|
|
144928
|
+
* "new_people": {
|
|
144929
|
+
* "window": {
|
|
144930
|
+
* "from": "2026-09-21",
|
|
144931
|
+
* "to": "2026-09-30"
|
|
144932
|
+
* },
|
|
144933
|
+
* "booking_start": "2026-09-21",
|
|
144934
|
+
* "mature_days": 3,
|
|
144935
|
+
* "unmeasured": null,
|
|
144936
|
+
* "people": 162,
|
|
144937
|
+
* "booked": 9,
|
|
144938
|
+
* "booked_rate": 0.056,
|
|
144939
|
+
* "paid": 2,
|
|
144940
|
+
* "paid_rate": 0.222,
|
|
144941
|
+
* "replied": 118,
|
|
144942
|
+
* "replied_booked": 9,
|
|
144943
|
+
* "replied_rate": 0.076,
|
|
144944
|
+
* "returned": {
|
|
144945
|
+
* "people": 31,
|
|
144946
|
+
* "booked": 3
|
|
144947
|
+
* }
|
|
144948
|
+
* }
|
|
144910
144949
|
* },
|
|
144911
144950
|
* "m3": {
|
|
144912
144951
|
* "quote_presented": 11,
|
|
@@ -171754,6 +171793,7 @@ interface paths {
|
|
|
171754
171793
|
* "no_show": 0,
|
|
171755
171794
|
* "late_cancel": 0,
|
|
171756
171795
|
* "cancelled": 0,
|
|
171796
|
+
* "cancelled_notice_unknown": 0,
|
|
171757
171797
|
* "unknown": 0
|
|
171758
171798
|
* },
|
|
171759
171799
|
* "closed_total": 0,
|
|
@@ -171761,7 +171801,7 @@ interface paths {
|
|
|
171761
171801
|
* "last_late_cancel_at": null,
|
|
171762
171802
|
* "last_no_show_at": null,
|
|
171763
171803
|
* "late_cancel_hours": 8,
|
|
171764
|
-
* "notice_basis": "
|
|
171804
|
+
* "notice_basis": "cancellation_recorded",
|
|
171765
171805
|
* "recent": [],
|
|
171766
171806
|
* "truncated": false,
|
|
171767
171807
|
* "patient": {
|
|
@@ -179309,9 +179349,9 @@ interface components {
|
|
|
179309
179349
|
to: string | null;
|
|
179310
179350
|
/** @description True when `from` was moved forward to the first AI booking (conversations before it could not be booked by the AI). */
|
|
179311
179351
|
starts_at_first_booking: boolean;
|
|
179312
|
-
/** @description Denominator — conversations Vitrina answered ALONE in the window: the person wrote, the AI agent replied after that message, and no team member (`human_user`) wrote before the AI booking (or in the whole window, with no booking). Tool calls, reasoning and events are not replies; an AI follow-up nobody answered is not counted. Quarantined conversations, system senders and team accounts are out. Every sucursal (conversations carry no location). */
|
|
179352
|
+
/** @description Denominator — conversations Vitrina answered ALONE in the window with NEW people (they had not written before the window — D94; the others are in `existing`): the person wrote, the AI agent replied after that message, and no team member (`human_user`) wrote before the AI booking (or in the whole window, with no booking). Tool calls, reasoning and events are not replies; an AI follow-up nobody answered is not counted. Quarantined conversations, system senders and team accounts are out. Every sucursal (conversations carry no location). */
|
|
179313
179353
|
conversations: number | null;
|
|
179314
|
-
/** @description Numerator — of `conversations`, those where the agent booked at least one cita (`source=agent`, not a public booking page; blocks and
|
|
179354
|
+
/** @description Numerator — of `conversations`, those where the agent booked at least one cita (`source=agent`, not a public booking page; blocks, holds and anuladas out) BOOKED inside the window. */
|
|
179315
179355
|
booked_conversations: number | null;
|
|
179316
179356
|
/** @description Citas the agent booked in those conversations (a conversation may book more than one). Counted by the day they were booked, unlike `bookings.ai` (by the day of the cita). */
|
|
179317
179357
|
ai_bookings: number | null;
|
|
@@ -179319,6 +179359,17 @@ interface components {
|
|
|
179319
179359
|
rate_pct: number | null;
|
|
179320
179360
|
/** @description Conversations the AI answered where a team member wrote before the outcome — excluded from the rate. */
|
|
179321
179361
|
team_helped: number | null;
|
|
179362
|
+
/** @description D94: conversations of people who had written to the business BEFORE the window (follow-ups, changes of hour) — outside the rate, said on their own line. `null` when not measured. */
|
|
179363
|
+
existing: {
|
|
179364
|
+
/** @description Conversations Vitrina answered alone with people who had written to the business BEFORE the window (patients’ follow-ups, changes of hour, earlier leads). */
|
|
179365
|
+
conversations: number;
|
|
179366
|
+
/** @description Of them, those where the agent booked at least one cita (anuladas excluded). */
|
|
179367
|
+
booked_conversations: number;
|
|
179368
|
+
/** @description Citas the agent booked in them. */
|
|
179369
|
+
ai_bookings: number;
|
|
179370
|
+
} | null;
|
|
179371
|
+
/** @description Citas the agent booked for new people in the window that were then anuladas — never in `ai_bookings`. `null` when not measured. */
|
|
179372
|
+
cancelled: number | null;
|
|
179322
179373
|
/** @description The read hit its row cap: counts are a floor. */
|
|
179323
179374
|
truncated: boolean;
|
|
179324
179375
|
/** @description The equal-length window right before, only when the AI was already booking through all of it; `null` otherwise (no fair baseline). */
|
|
@@ -181878,7 +181929,7 @@ interface components {
|
|
|
181878
181929
|
};
|
|
181879
181930
|
AdsPeople: {
|
|
181880
181931
|
/** @enum {string} */
|
|
181881
|
-
metric: "paid_patients" | "arrived_patients" | "returned_patients" | "funnel_contacted" | "funnel_booked" | "funnel_attended" | "funnel_quote_presented" | "funnel_accepted" | "funnel_paid" | "conversations" | "conversations_replied" | "conversations_booked" | "conversations_attended" | "conversations_closed";
|
|
181932
|
+
metric: "paid_patients" | "arrived_patients" | "returned_patients" | "funnel_contacted" | "funnel_booked" | "funnel_attended" | "funnel_quote_presented" | "funnel_accepted" | "funnel_paid" | "new_people" | "new_people_booked" | "new_people_paid" | "returned_people" | "returned_people_booked" | "conversations" | "conversations_replied" | "conversations_booked" | "conversations_attended" | "conversations_closed";
|
|
181882
181933
|
/** @description The days the population is counted over — the count’s own window (patient return: clipped to the first measured day, as `/ads/overview`; conversations: the `/ads/campaigns` conversational window). */
|
|
181883
181934
|
window: {
|
|
181884
181935
|
from: string;
|
|
@@ -182449,6 +182500,43 @@ interface components {
|
|
|
182449
182500
|
* @enum {string|null}
|
|
182450
182501
|
*/
|
|
182451
182502
|
rate_not_comparable: "conversations_late" | "booking_link" | null;
|
|
182503
|
+
/** @description D93 — M2’s own cohort, the one its verdict (`weakest`) is judged on. Unlike `booked` (the `/ads/funnel` cohort: every person from ads in the period, «volvieron» included, any step reached), it counts new people only, from the booking start, mature days only, real citas only. Absent when it could not be read. */
|
|
182504
|
+
new_people?: {
|
|
182505
|
+
/** @description The days counted: the period from `booking_start`, without the last `mature_days` days (a person who wrote yesterday has had no time to book). `null` = no such day (`unmeasured`). */
|
|
182506
|
+
window: {
|
|
182507
|
+
from: string;
|
|
182508
|
+
to: string;
|
|
182509
|
+
} | null;
|
|
182510
|
+
/** @description The first day the assistant answered people (at least 5 on one day), derived from the messages. `null` = it never answered anyone: the window then starts with the conversations Vitrina measures. */
|
|
182511
|
+
booking_start: string | null;
|
|
182512
|
+
mature_days: number;
|
|
182513
|
+
/**
|
|
182514
|
+
* @description `before_booking_start` = the period ends before the assistant started; `too_recent` = all its days since then are within the last `mature_days`. `null` = measured.
|
|
182515
|
+
* @enum {string|null}
|
|
182516
|
+
*/
|
|
182517
|
+
unmeasured: "before_booking_start" | "too_recent" | null;
|
|
182518
|
+
/** @description NEW people whose first message came from an ad and fell in `window` (never «volvieron»). */
|
|
182519
|
+
people: number;
|
|
182520
|
+
/** @description Of `people`, with a REAL cita booked since their first message (D91: booked by Vitrina, by reception or mirrored from the clinic software; anuladas out). A quote or a payment with no cita is not «agendó». */
|
|
182521
|
+
booked: number;
|
|
182522
|
+
/** @description booked ÷ people — THE number held against the 10–15 % band. */
|
|
182523
|
+
booked_rate: number | null;
|
|
182524
|
+
/** @description Of `booked`, those who paid. */
|
|
182525
|
+
paid: number;
|
|
182526
|
+
/** @description paid ÷ booked. */
|
|
182527
|
+
paid_rate: number | null;
|
|
182528
|
+
/** @description «Respondieron»: of `people`, who wrote again after the first answer they saw (within 7 days of their first message). */
|
|
182529
|
+
replied: number;
|
|
182530
|
+
/** @description Of `replied`, with a real cita. */
|
|
182531
|
+
replied_booked: number;
|
|
182532
|
+
/** @description replied_booked ÷ replied. */
|
|
182533
|
+
replied_rate: number | null;
|
|
182534
|
+
/** @description «Volvieron»: people an ad brought BACK in `window` (they had written before) and, of them, with a real cita since — their own line, never in the rate. */
|
|
182535
|
+
returned: {
|
|
182536
|
+
people: number;
|
|
182537
|
+
booked: number;
|
|
182538
|
+
};
|
|
182539
|
+
};
|
|
182452
182540
|
};
|
|
182453
182541
|
/** @description M3 · Venta en clínica (the professional). The same people as `/ads/funnel`. */
|
|
182454
182542
|
m3: {
|
|
@@ -182507,7 +182595,7 @@ interface components {
|
|
|
182507
182595
|
};
|
|
182508
182596
|
};
|
|
182509
182597
|
/**
|
|
182510
|
-
* @description Where it leaks, deterministically and only where a benchmark exists: `m1` = spend and nobody wrote (no credited person from ads AND no ad-opened conversation in `m2.ad_conversations`); `m2` = writing → booking under the program reference low (10 %) while `m2.booked_measured`; `null` = neither, and always when Vitrina does not measure conversations from the window’s first day. M3 is never judged: there is no program benchmark for quotes → payment, so `m3.paid_rate` is shown without a verdict.
|
|
182598
|
+
* @description Where it leaks, deterministically and only where a benchmark exists: `m1` = spend and nobody wrote (no credited person from ads AND no ad-opened conversation in `m2.ad_conversations`); `m2` = writing → booking (`m2.new_people.booked_rate` when present) under the program reference low (10 %) while `m2.booked_measured`; `null` = neither, and always when Vitrina does not measure conversations from the window’s first day. M3 is never judged: there is no program benchmark for quotes → payment, so `m3.paid_rate` is shown without a verdict.
|
|
182511
182599
|
* @enum {string|null}
|
|
182512
182600
|
*/
|
|
182513
182601
|
weakest: "m1" | "m2" | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -142778,9 +142778,10 @@ interface paths {
|
|
|
142778
142778
|
* @description WHICH count to list — each is read from the very read the count is folded from, so `count` equals the number the screen shows:
|
|
142779
142779
|
* · `paid_patients` / `arrived_patients` / `returned_patients` — `patient_return.patients` / `.arrived_patients` / `.returned_patients` of `/ads/overview` (no scope), of a `/ads/campaigns` row (`campaign_id`), of an ad (`ad_id`), or «Anuncios aún sin campaña conocida» (`unplaced=1`).
|
|
142780
142780
|
* · `funnel_<step>` — `/ads/funnel` `steps[<step>].ads` = `/ads/stages` M1 `m1.conversations` (`funnel_contacted`), M2 `m2.booked` / `m2.attended`, M3 `m3.quote_presented` / `m3.accepted` / `m3.paid`. No scope.
|
|
142781
|
+
* · `new_people[_booked|_paid]`, `returned_people[_booked]` — `/ads/stages` `m2.new_people` (D93): `people` / `booked` / `paid` and `returned.people` / `returned.booked`, over that block’s own `window` (the read’s `window`). No scope.
|
|
142781
142782
|
* · `conversations[_replied|_booked|_attended|_closed]` — the conversations ads opened (one row per CONVERSATION), all ads, one campaign (`campaign_id`, through the ad → campaign map as `/ads/campaigns` counts them) or one ad (`ad_id`).
|
|
142782
142783
|
*/
|
|
142783
|
-
metric: "paid_patients" | "arrived_patients" | "returned_patients" | "funnel_contacted" | "funnel_booked" | "funnel_attended" | "funnel_quote_presented" | "funnel_accepted" | "funnel_paid" | "conversations" | "conversations_replied" | "conversations_booked" | "conversations_attended" | "conversations_closed";
|
|
142784
|
+
metric: "paid_patients" | "arrived_patients" | "returned_patients" | "funnel_contacted" | "funnel_booked" | "funnel_attended" | "funnel_quote_presented" | "funnel_accepted" | "funnel_paid" | "new_people" | "new_people_booked" | "new_people_paid" | "returned_people" | "returned_people_booked" | "conversations" | "conversations_replied" | "conversations_booked" | "conversations_attended" | "conversations_closed";
|
|
142784
142785
|
/** @description A campaign’s PLATFORM id (`/ads/campaigns` `campaign_external_id`). Patient-return and conversation metrics only. */
|
|
142785
142786
|
campaign_id?: string;
|
|
142786
142787
|
/** @description An ad’s PLATFORM id. Patient-return and conversation metrics only. */
|
|
@@ -143703,7 +143704,13 @@ interface paths {
|
|
|
143703
143704
|
* "booked_conversations": 45,
|
|
143704
143705
|
* "ai_bookings": 54,
|
|
143705
143706
|
* "rate_pct": 7.7,
|
|
143706
|
-
* "team_helped": 60
|
|
143707
|
+
* "team_helped": 60,
|
|
143708
|
+
* "existing": {
|
|
143709
|
+
* "conversations": 214,
|
|
143710
|
+
* "booked_conversations": 38,
|
|
143711
|
+
* "ai_bookings": 41
|
|
143712
|
+
* },
|
|
143713
|
+
* "cancelled": 6
|
|
143707
143714
|
* },
|
|
143708
143715
|
* "from_ads": {
|
|
143709
143716
|
* "conversations": 461,
|
|
@@ -143789,11 +143796,11 @@ interface paths {
|
|
|
143789
143796
|
first_ai_booked_on: string | null;
|
|
143790
143797
|
timezone: string;
|
|
143791
143798
|
min_conversations: number;
|
|
143792
|
-
/** @description The same figure as `conversation_rate` on `GET /clinic/insights/resultados` for the same days. */
|
|
143799
|
+
/** @description The same figure as `conversation_rate` on `GET /clinic/insights/resultados` for the same days. NEW PEOPLE ONLY (D94): conversations of people who had written before the window are counted in `existing`, never in the rate — nor in `from_ads`, `without_ad`, `by_campaign`, `by_ad`, `by_hour`. */
|
|
143793
143800
|
overall: {
|
|
143794
|
-
/** @description Conversations Vitrina answered ALONE: the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143801
|
+
/** @description Conversations Vitrina answered ALONE with NEW people (they had not written before the window): the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143795
143802
|
conversations: number;
|
|
143796
|
-
/** @description Of `conversations`, those where the agent booked at least one cita inside the window. */
|
|
143803
|
+
/** @description Of `conversations`, those where the agent booked at least one cita inside the window (anuladas excluded). */
|
|
143797
143804
|
booked_conversations: number;
|
|
143798
143805
|
/** @description Citas the agent booked in those conversations (≥ `booked_conversations`). */
|
|
143799
143806
|
ai_bookings: number;
|
|
@@ -143801,12 +143808,23 @@ interface paths {
|
|
|
143801
143808
|
rate_pct: number | null;
|
|
143802
143809
|
/** @description Conversations the AI answered where a team member wrote first — excluded. */
|
|
143803
143810
|
team_helped: number;
|
|
143811
|
+
/** @description People who had written before the window (D94): OUTSIDE the rate — its headline counts new people only — and shown on their own line. */
|
|
143812
|
+
existing: {
|
|
143813
|
+
/** @description Conversations Vitrina answered alone with people who had written to the business BEFORE the window (patients’ follow-ups, changes of hour, earlier leads). */
|
|
143814
|
+
conversations: number;
|
|
143815
|
+
/** @description Of them, those where the agent booked at least one cita (anuladas excluded). */
|
|
143816
|
+
booked_conversations: number;
|
|
143817
|
+
/** @description Citas the agent booked in them. */
|
|
143818
|
+
ai_bookings: number;
|
|
143819
|
+
};
|
|
143820
|
+
/** @description Citas the agent booked for new people in the window that were then anuladas — never in `ai_bookings`. */
|
|
143821
|
+
cancelled: number;
|
|
143804
143822
|
} | null;
|
|
143805
143823
|
/** @description Conversations a Meta ad opened (its `ad_referral`). */
|
|
143806
143824
|
from_ads: {
|
|
143807
|
-
/** @description Conversations Vitrina answered ALONE: the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143825
|
+
/** @description Conversations Vitrina answered ALONE with NEW people (they had not written before the window): the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143808
143826
|
conversations: number;
|
|
143809
|
-
/** @description Of `conversations`, those where the agent booked at least one cita inside the window. */
|
|
143827
|
+
/** @description Of `conversations`, those where the agent booked at least one cita inside the window (anuladas excluded). */
|
|
143810
143828
|
booked_conversations: number;
|
|
143811
143829
|
/** @description Citas the agent booked in those conversations (≥ `booked_conversations`). */
|
|
143812
143830
|
ai_bookings: number;
|
|
@@ -143814,9 +143832,9 @@ interface paths {
|
|
|
143814
143832
|
rate_pct: number | null;
|
|
143815
143833
|
} | null;
|
|
143816
143834
|
without_ad: {
|
|
143817
|
-
/** @description Conversations Vitrina answered ALONE: the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143835
|
+
/** @description Conversations Vitrina answered ALONE with NEW people (they had not written before the window): the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143818
143836
|
conversations: number;
|
|
143819
|
-
/** @description Of `conversations`, those where the agent booked at least one cita inside the window. */
|
|
143837
|
+
/** @description Of `conversations`, those where the agent booked at least one cita inside the window (anuladas excluded). */
|
|
143820
143838
|
booked_conversations: number;
|
|
143821
143839
|
/** @description Citas the agent booked in those conversations (≥ `booked_conversations`). */
|
|
143822
143840
|
ai_bookings: number;
|
|
@@ -143833,9 +143851,9 @@ interface paths {
|
|
|
143833
143851
|
/** @description Meta's campaign id (= `/ads/campaigns` rows). */
|
|
143834
143852
|
campaign_external_id: string;
|
|
143835
143853
|
campaign_name: string | null;
|
|
143836
|
-
/** @description Conversations Vitrina answered ALONE: the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143854
|
+
/** @description Conversations Vitrina answered ALONE with NEW people (they had not written before the window): the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143837
143855
|
conversations: number;
|
|
143838
|
-
/** @description Of `conversations`, those where the agent booked at least one cita inside the window. */
|
|
143856
|
+
/** @description Of `conversations`, those where the agent booked at least one cita inside the window (anuladas excluded). */
|
|
143839
143857
|
booked_conversations: number;
|
|
143840
143858
|
/** @description Citas the agent booked in those conversations (≥ `booked_conversations`). */
|
|
143841
143859
|
ai_bookings: number;
|
|
@@ -143850,9 +143868,9 @@ interface paths {
|
|
|
143850
143868
|
/** @description Meta's ad id (= `/ads/creatives` rows). */
|
|
143851
143869
|
ad_external_id: string;
|
|
143852
143870
|
campaign_external_id: string | null;
|
|
143853
|
-
/** @description Conversations Vitrina answered ALONE: the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143871
|
+
/** @description Conversations Vitrina answered ALONE with NEW people (they had not written before the window): the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143854
143872
|
conversations: number;
|
|
143855
|
-
/** @description Of `conversations`, those where the agent booked at least one cita inside the window. */
|
|
143873
|
+
/** @description Of `conversations`, those where the agent booked at least one cita inside the window (anuladas excluded). */
|
|
143856
143874
|
booked_conversations: number;
|
|
143857
143875
|
/** @description Citas the agent booked in those conversations (≥ `booked_conversations`). */
|
|
143858
143876
|
ai_bookings: number;
|
|
@@ -143864,9 +143882,9 @@ interface paths {
|
|
|
143864
143882
|
/** @description 24 rows, by the hour (in `timezone`) of the person's first message in the window. */
|
|
143865
143883
|
by_hour: {
|
|
143866
143884
|
hour: number;
|
|
143867
|
-
/** @description Conversations Vitrina answered ALONE: the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143885
|
+
/** @description Conversations Vitrina answered ALONE with NEW people (they had not written before the window): the person wrote, the AI agent replied after that message, and no team member wrote before the AI booking (or in the whole window, with no booking). */
|
|
143868
143886
|
conversations: number;
|
|
143869
|
-
/** @description Of `conversations`, those where the agent booked at least one cita inside the window. */
|
|
143887
|
+
/** @description Of `conversations`, those where the agent booked at least one cita inside the window (anuladas excluded). */
|
|
143870
143888
|
booked_conversations: number;
|
|
143871
143889
|
/** @description Citas the agent booked in those conversations (≥ `booked_conversations`). */
|
|
143872
143890
|
ai_bookings: number;
|
|
@@ -144906,7 +144924,28 @@ interface paths {
|
|
|
144906
144924
|
* "booked": 24,
|
|
144907
144925
|
* "attended": 15,
|
|
144908
144926
|
* "booked_rate": 0.112,
|
|
144909
|
-
* "attended_rate": 0.625
|
|
144927
|
+
* "attended_rate": 0.625,
|
|
144928
|
+
* "new_people": {
|
|
144929
|
+
* "window": {
|
|
144930
|
+
* "from": "2026-09-21",
|
|
144931
|
+
* "to": "2026-09-30"
|
|
144932
|
+
* },
|
|
144933
|
+
* "booking_start": "2026-09-21",
|
|
144934
|
+
* "mature_days": 3,
|
|
144935
|
+
* "unmeasured": null,
|
|
144936
|
+
* "people": 162,
|
|
144937
|
+
* "booked": 9,
|
|
144938
|
+
* "booked_rate": 0.056,
|
|
144939
|
+
* "paid": 2,
|
|
144940
|
+
* "paid_rate": 0.222,
|
|
144941
|
+
* "replied": 118,
|
|
144942
|
+
* "replied_booked": 9,
|
|
144943
|
+
* "replied_rate": 0.076,
|
|
144944
|
+
* "returned": {
|
|
144945
|
+
* "people": 31,
|
|
144946
|
+
* "booked": 3
|
|
144947
|
+
* }
|
|
144948
|
+
* }
|
|
144910
144949
|
* },
|
|
144911
144950
|
* "m3": {
|
|
144912
144951
|
* "quote_presented": 11,
|
|
@@ -171754,6 +171793,7 @@ interface paths {
|
|
|
171754
171793
|
* "no_show": 0,
|
|
171755
171794
|
* "late_cancel": 0,
|
|
171756
171795
|
* "cancelled": 0,
|
|
171796
|
+
* "cancelled_notice_unknown": 0,
|
|
171757
171797
|
* "unknown": 0
|
|
171758
171798
|
* },
|
|
171759
171799
|
* "closed_total": 0,
|
|
@@ -171761,7 +171801,7 @@ interface paths {
|
|
|
171761
171801
|
* "last_late_cancel_at": null,
|
|
171762
171802
|
* "last_no_show_at": null,
|
|
171763
171803
|
* "late_cancel_hours": 8,
|
|
171764
|
-
* "notice_basis": "
|
|
171804
|
+
* "notice_basis": "cancellation_recorded",
|
|
171765
171805
|
* "recent": [],
|
|
171766
171806
|
* "truncated": false,
|
|
171767
171807
|
* "patient": {
|
|
@@ -179309,9 +179349,9 @@ interface components {
|
|
|
179309
179349
|
to: string | null;
|
|
179310
179350
|
/** @description True when `from` was moved forward to the first AI booking (conversations before it could not be booked by the AI). */
|
|
179311
179351
|
starts_at_first_booking: boolean;
|
|
179312
|
-
/** @description Denominator — conversations Vitrina answered ALONE in the window: the person wrote, the AI agent replied after that message, and no team member (`human_user`) wrote before the AI booking (or in the whole window, with no booking). Tool calls, reasoning and events are not replies; an AI follow-up nobody answered is not counted. Quarantined conversations, system senders and team accounts are out. Every sucursal (conversations carry no location). */
|
|
179352
|
+
/** @description Denominator — conversations Vitrina answered ALONE in the window with NEW people (they had not written before the window — D94; the others are in `existing`): the person wrote, the AI agent replied after that message, and no team member (`human_user`) wrote before the AI booking (or in the whole window, with no booking). Tool calls, reasoning and events are not replies; an AI follow-up nobody answered is not counted. Quarantined conversations, system senders and team accounts are out. Every sucursal (conversations carry no location). */
|
|
179313
179353
|
conversations: number | null;
|
|
179314
|
-
/** @description Numerator — of `conversations`, those where the agent booked at least one cita (`source=agent`, not a public booking page; blocks and
|
|
179354
|
+
/** @description Numerator — of `conversations`, those where the agent booked at least one cita (`source=agent`, not a public booking page; blocks, holds and anuladas out) BOOKED inside the window. */
|
|
179315
179355
|
booked_conversations: number | null;
|
|
179316
179356
|
/** @description Citas the agent booked in those conversations (a conversation may book more than one). Counted by the day they were booked, unlike `bookings.ai` (by the day of the cita). */
|
|
179317
179357
|
ai_bookings: number | null;
|
|
@@ -179319,6 +179359,17 @@ interface components {
|
|
|
179319
179359
|
rate_pct: number | null;
|
|
179320
179360
|
/** @description Conversations the AI answered where a team member wrote before the outcome — excluded from the rate. */
|
|
179321
179361
|
team_helped: number | null;
|
|
179362
|
+
/** @description D94: conversations of people who had written to the business BEFORE the window (follow-ups, changes of hour) — outside the rate, said on their own line. `null` when not measured. */
|
|
179363
|
+
existing: {
|
|
179364
|
+
/** @description Conversations Vitrina answered alone with people who had written to the business BEFORE the window (patients’ follow-ups, changes of hour, earlier leads). */
|
|
179365
|
+
conversations: number;
|
|
179366
|
+
/** @description Of them, those where the agent booked at least one cita (anuladas excluded). */
|
|
179367
|
+
booked_conversations: number;
|
|
179368
|
+
/** @description Citas the agent booked in them. */
|
|
179369
|
+
ai_bookings: number;
|
|
179370
|
+
} | null;
|
|
179371
|
+
/** @description Citas the agent booked for new people in the window that were then anuladas — never in `ai_bookings`. `null` when not measured. */
|
|
179372
|
+
cancelled: number | null;
|
|
179322
179373
|
/** @description The read hit its row cap: counts are a floor. */
|
|
179323
179374
|
truncated: boolean;
|
|
179324
179375
|
/** @description The equal-length window right before, only when the AI was already booking through all of it; `null` otherwise (no fair baseline). */
|
|
@@ -181878,7 +181929,7 @@ interface components {
|
|
|
181878
181929
|
};
|
|
181879
181930
|
AdsPeople: {
|
|
181880
181931
|
/** @enum {string} */
|
|
181881
|
-
metric: "paid_patients" | "arrived_patients" | "returned_patients" | "funnel_contacted" | "funnel_booked" | "funnel_attended" | "funnel_quote_presented" | "funnel_accepted" | "funnel_paid" | "conversations" | "conversations_replied" | "conversations_booked" | "conversations_attended" | "conversations_closed";
|
|
181932
|
+
metric: "paid_patients" | "arrived_patients" | "returned_patients" | "funnel_contacted" | "funnel_booked" | "funnel_attended" | "funnel_quote_presented" | "funnel_accepted" | "funnel_paid" | "new_people" | "new_people_booked" | "new_people_paid" | "returned_people" | "returned_people_booked" | "conversations" | "conversations_replied" | "conversations_booked" | "conversations_attended" | "conversations_closed";
|
|
181882
181933
|
/** @description The days the population is counted over — the count’s own window (patient return: clipped to the first measured day, as `/ads/overview`; conversations: the `/ads/campaigns` conversational window). */
|
|
181883
181934
|
window: {
|
|
181884
181935
|
from: string;
|
|
@@ -182449,6 +182500,43 @@ interface components {
|
|
|
182449
182500
|
* @enum {string|null}
|
|
182450
182501
|
*/
|
|
182451
182502
|
rate_not_comparable: "conversations_late" | "booking_link" | null;
|
|
182503
|
+
/** @description D93 — M2’s own cohort, the one its verdict (`weakest`) is judged on. Unlike `booked` (the `/ads/funnel` cohort: every person from ads in the period, «volvieron» included, any step reached), it counts new people only, from the booking start, mature days only, real citas only. Absent when it could not be read. */
|
|
182504
|
+
new_people?: {
|
|
182505
|
+
/** @description The days counted: the period from `booking_start`, without the last `mature_days` days (a person who wrote yesterday has had no time to book). `null` = no such day (`unmeasured`). */
|
|
182506
|
+
window: {
|
|
182507
|
+
from: string;
|
|
182508
|
+
to: string;
|
|
182509
|
+
} | null;
|
|
182510
|
+
/** @description The first day the assistant answered people (at least 5 on one day), derived from the messages. `null` = it never answered anyone: the window then starts with the conversations Vitrina measures. */
|
|
182511
|
+
booking_start: string | null;
|
|
182512
|
+
mature_days: number;
|
|
182513
|
+
/**
|
|
182514
|
+
* @description `before_booking_start` = the period ends before the assistant started; `too_recent` = all its days since then are within the last `mature_days`. `null` = measured.
|
|
182515
|
+
* @enum {string|null}
|
|
182516
|
+
*/
|
|
182517
|
+
unmeasured: "before_booking_start" | "too_recent" | null;
|
|
182518
|
+
/** @description NEW people whose first message came from an ad and fell in `window` (never «volvieron»). */
|
|
182519
|
+
people: number;
|
|
182520
|
+
/** @description Of `people`, with a REAL cita booked since their first message (D91: booked by Vitrina, by reception or mirrored from the clinic software; anuladas out). A quote or a payment with no cita is not «agendó». */
|
|
182521
|
+
booked: number;
|
|
182522
|
+
/** @description booked ÷ people — THE number held against the 10–15 % band. */
|
|
182523
|
+
booked_rate: number | null;
|
|
182524
|
+
/** @description Of `booked`, those who paid. */
|
|
182525
|
+
paid: number;
|
|
182526
|
+
/** @description paid ÷ booked. */
|
|
182527
|
+
paid_rate: number | null;
|
|
182528
|
+
/** @description «Respondieron»: of `people`, who wrote again after the first answer they saw (within 7 days of their first message). */
|
|
182529
|
+
replied: number;
|
|
182530
|
+
/** @description Of `replied`, with a real cita. */
|
|
182531
|
+
replied_booked: number;
|
|
182532
|
+
/** @description replied_booked ÷ replied. */
|
|
182533
|
+
replied_rate: number | null;
|
|
182534
|
+
/** @description «Volvieron»: people an ad brought BACK in `window` (they had written before) and, of them, with a real cita since — their own line, never in the rate. */
|
|
182535
|
+
returned: {
|
|
182536
|
+
people: number;
|
|
182537
|
+
booked: number;
|
|
182538
|
+
};
|
|
182539
|
+
};
|
|
182452
182540
|
};
|
|
182453
182541
|
/** @description M3 · Venta en clínica (the professional). The same people as `/ads/funnel`. */
|
|
182454
182542
|
m3: {
|
|
@@ -182507,7 +182595,7 @@ interface components {
|
|
|
182507
182595
|
};
|
|
182508
182596
|
};
|
|
182509
182597
|
/**
|
|
182510
|
-
* @description Where it leaks, deterministically and only where a benchmark exists: `m1` = spend and nobody wrote (no credited person from ads AND no ad-opened conversation in `m2.ad_conversations`); `m2` = writing → booking under the program reference low (10 %) while `m2.booked_measured`; `null` = neither, and always when Vitrina does not measure conversations from the window’s first day. M3 is never judged: there is no program benchmark for quotes → payment, so `m3.paid_rate` is shown without a verdict.
|
|
182598
|
+
* @description Where it leaks, deterministically and only where a benchmark exists: `m1` = spend and nobody wrote (no credited person from ads AND no ad-opened conversation in `m2.ad_conversations`); `m2` = writing → booking (`m2.new_people.booked_rate` when present) under the program reference low (10 %) while `m2.booked_measured`; `null` = neither, and always when Vitrina does not measure conversations from the window’s first day. M3 is never judged: there is no program benchmark for quotes → payment, so `m3.paid_rate` is shown without a verdict.
|
|
182511
182599
|
* @enum {string|null}
|
|
182512
182600
|
*/
|
|
182513
182601
|
weakest: "m1" | "m2" | null;
|
package/package.json
CHANGED