@vitrina/api 14.3.0 → 14.3.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 +107 -20
- package/dist/index.d.ts +107 -20
- 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,
|
|
@@ -179309,9 +179348,9 @@ interface components {
|
|
|
179309
179348
|
to: string | null;
|
|
179310
179349
|
/** @description True when `from` was moved forward to the first AI booking (conversations before it could not be booked by the AI). */
|
|
179311
179350
|
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). */
|
|
179351
|
+
/** @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
179352
|
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
|
|
179353
|
+
/** @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
179354
|
booked_conversations: number | null;
|
|
179316
179355
|
/** @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
179356
|
ai_bookings: number | null;
|
|
@@ -179319,6 +179358,17 @@ interface components {
|
|
|
179319
179358
|
rate_pct: number | null;
|
|
179320
179359
|
/** @description Conversations the AI answered where a team member wrote before the outcome — excluded from the rate. */
|
|
179321
179360
|
team_helped: number | null;
|
|
179361
|
+
/** @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. */
|
|
179362
|
+
existing: {
|
|
179363
|
+
/** @description Conversations Vitrina answered alone with people who had written to the business BEFORE the window (patients’ follow-ups, changes of hour, earlier leads). */
|
|
179364
|
+
conversations: number;
|
|
179365
|
+
/** @description Of them, those where the agent booked at least one cita (anuladas excluded). */
|
|
179366
|
+
booked_conversations: number;
|
|
179367
|
+
/** @description Citas the agent booked in them. */
|
|
179368
|
+
ai_bookings: number;
|
|
179369
|
+
} | null;
|
|
179370
|
+
/** @description Citas the agent booked for new people in the window that were then anuladas — never in `ai_bookings`. `null` when not measured. */
|
|
179371
|
+
cancelled: number | null;
|
|
179322
179372
|
/** @description The read hit its row cap: counts are a floor. */
|
|
179323
179373
|
truncated: boolean;
|
|
179324
179374
|
/** @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 +181928,7 @@ interface components {
|
|
|
181878
181928
|
};
|
|
181879
181929
|
AdsPeople: {
|
|
181880
181930
|
/** @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";
|
|
181931
|
+
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
181932
|
/** @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
181933
|
window: {
|
|
181884
181934
|
from: string;
|
|
@@ -182449,6 +182499,43 @@ interface components {
|
|
|
182449
182499
|
* @enum {string|null}
|
|
182450
182500
|
*/
|
|
182451
182501
|
rate_not_comparable: "conversations_late" | "booking_link" | null;
|
|
182502
|
+
/** @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. */
|
|
182503
|
+
new_people?: {
|
|
182504
|
+
/** @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`). */
|
|
182505
|
+
window: {
|
|
182506
|
+
from: string;
|
|
182507
|
+
to: string;
|
|
182508
|
+
} | null;
|
|
182509
|
+
/** @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. */
|
|
182510
|
+
booking_start: string | null;
|
|
182511
|
+
mature_days: number;
|
|
182512
|
+
/**
|
|
182513
|
+
* @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.
|
|
182514
|
+
* @enum {string|null}
|
|
182515
|
+
*/
|
|
182516
|
+
unmeasured: "before_booking_start" | "too_recent" | null;
|
|
182517
|
+
/** @description NEW people whose first message came from an ad and fell in `window` (never «volvieron»). */
|
|
182518
|
+
people: number;
|
|
182519
|
+
/** @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ó». */
|
|
182520
|
+
booked: number;
|
|
182521
|
+
/** @description booked ÷ people — THE number held against the 10–15 % band. */
|
|
182522
|
+
booked_rate: number | null;
|
|
182523
|
+
/** @description Of `booked`, those who paid. */
|
|
182524
|
+
paid: number;
|
|
182525
|
+
/** @description paid ÷ booked. */
|
|
182526
|
+
paid_rate: number | null;
|
|
182527
|
+
/** @description «Respondieron»: of `people`, who wrote again after the first answer they saw (within 7 days of their first message). */
|
|
182528
|
+
replied: number;
|
|
182529
|
+
/** @description Of `replied`, with a real cita. */
|
|
182530
|
+
replied_booked: number;
|
|
182531
|
+
/** @description replied_booked ÷ replied. */
|
|
182532
|
+
replied_rate: number | null;
|
|
182533
|
+
/** @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. */
|
|
182534
|
+
returned: {
|
|
182535
|
+
people: number;
|
|
182536
|
+
booked: number;
|
|
182537
|
+
};
|
|
182538
|
+
};
|
|
182452
182539
|
};
|
|
182453
182540
|
/** @description M3 · Venta en clínica (the professional). The same people as `/ads/funnel`. */
|
|
182454
182541
|
m3: {
|
|
@@ -182507,7 +182594,7 @@ interface components {
|
|
|
182507
182594
|
};
|
|
182508
182595
|
};
|
|
182509
182596
|
/**
|
|
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.
|
|
182597
|
+
* @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
182598
|
* @enum {string|null}
|
|
182512
182599
|
*/
|
|
182513
182600
|
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,
|
|
@@ -179309,9 +179348,9 @@ interface components {
|
|
|
179309
179348
|
to: string | null;
|
|
179310
179349
|
/** @description True when `from` was moved forward to the first AI booking (conversations before it could not be booked by the AI). */
|
|
179311
179350
|
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). */
|
|
179351
|
+
/** @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
179352
|
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
|
|
179353
|
+
/** @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
179354
|
booked_conversations: number | null;
|
|
179316
179355
|
/** @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
179356
|
ai_bookings: number | null;
|
|
@@ -179319,6 +179358,17 @@ interface components {
|
|
|
179319
179358
|
rate_pct: number | null;
|
|
179320
179359
|
/** @description Conversations the AI answered where a team member wrote before the outcome — excluded from the rate. */
|
|
179321
179360
|
team_helped: number | null;
|
|
179361
|
+
/** @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. */
|
|
179362
|
+
existing: {
|
|
179363
|
+
/** @description Conversations Vitrina answered alone with people who had written to the business BEFORE the window (patients’ follow-ups, changes of hour, earlier leads). */
|
|
179364
|
+
conversations: number;
|
|
179365
|
+
/** @description Of them, those where the agent booked at least one cita (anuladas excluded). */
|
|
179366
|
+
booked_conversations: number;
|
|
179367
|
+
/** @description Citas the agent booked in them. */
|
|
179368
|
+
ai_bookings: number;
|
|
179369
|
+
} | null;
|
|
179370
|
+
/** @description Citas the agent booked for new people in the window that were then anuladas — never in `ai_bookings`. `null` when not measured. */
|
|
179371
|
+
cancelled: number | null;
|
|
179322
179372
|
/** @description The read hit its row cap: counts are a floor. */
|
|
179323
179373
|
truncated: boolean;
|
|
179324
179374
|
/** @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 +181928,7 @@ interface components {
|
|
|
181878
181928
|
};
|
|
181879
181929
|
AdsPeople: {
|
|
181880
181930
|
/** @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";
|
|
181931
|
+
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
181932
|
/** @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
181933
|
window: {
|
|
181884
181934
|
from: string;
|
|
@@ -182449,6 +182499,43 @@ interface components {
|
|
|
182449
182499
|
* @enum {string|null}
|
|
182450
182500
|
*/
|
|
182451
182501
|
rate_not_comparable: "conversations_late" | "booking_link" | null;
|
|
182502
|
+
/** @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. */
|
|
182503
|
+
new_people?: {
|
|
182504
|
+
/** @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`). */
|
|
182505
|
+
window: {
|
|
182506
|
+
from: string;
|
|
182507
|
+
to: string;
|
|
182508
|
+
} | null;
|
|
182509
|
+
/** @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. */
|
|
182510
|
+
booking_start: string | null;
|
|
182511
|
+
mature_days: number;
|
|
182512
|
+
/**
|
|
182513
|
+
* @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.
|
|
182514
|
+
* @enum {string|null}
|
|
182515
|
+
*/
|
|
182516
|
+
unmeasured: "before_booking_start" | "too_recent" | null;
|
|
182517
|
+
/** @description NEW people whose first message came from an ad and fell in `window` (never «volvieron»). */
|
|
182518
|
+
people: number;
|
|
182519
|
+
/** @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ó». */
|
|
182520
|
+
booked: number;
|
|
182521
|
+
/** @description booked ÷ people — THE number held against the 10–15 % band. */
|
|
182522
|
+
booked_rate: number | null;
|
|
182523
|
+
/** @description Of `booked`, those who paid. */
|
|
182524
|
+
paid: number;
|
|
182525
|
+
/** @description paid ÷ booked. */
|
|
182526
|
+
paid_rate: number | null;
|
|
182527
|
+
/** @description «Respondieron»: of `people`, who wrote again after the first answer they saw (within 7 days of their first message). */
|
|
182528
|
+
replied: number;
|
|
182529
|
+
/** @description Of `replied`, with a real cita. */
|
|
182530
|
+
replied_booked: number;
|
|
182531
|
+
/** @description replied_booked ÷ replied. */
|
|
182532
|
+
replied_rate: number | null;
|
|
182533
|
+
/** @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. */
|
|
182534
|
+
returned: {
|
|
182535
|
+
people: number;
|
|
182536
|
+
booked: number;
|
|
182537
|
+
};
|
|
182538
|
+
};
|
|
182452
182539
|
};
|
|
182453
182540
|
/** @description M3 · Venta en clínica (the professional). The same people as `/ads/funnel`. */
|
|
182454
182541
|
m3: {
|
|
@@ -182507,7 +182594,7 @@ interface components {
|
|
|
182507
182594
|
};
|
|
182508
182595
|
};
|
|
182509
182596
|
/**
|
|
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.
|
|
182597
|
+
* @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
182598
|
* @enum {string|null}
|
|
182512
182599
|
*/
|
|
182513
182600
|
weakest: "m1" | "m2" | null;
|
package/package.json
CHANGED