@vitrina/api 11.30.0 → 11.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -39989,7 +39989,7 @@ interface paths {
39989
39989
  patch?: never;
39990
39990
  trace?: never;
39991
39991
  };
39992
- "/clinic/cash-sessions/current": {
39992
+ "/clinic/diagnostico": {
39993
39993
  parameters: {
39994
39994
  query?: never;
39995
39995
  header?: never;
@@ -39997,23 +39997,21 @@ interface paths {
39997
39997
  cookie?: never;
39998
39998
  };
39999
39999
  /**
40000
- * The open caja session at a sucursal
40001
- * @description The shift at `location_id`, with `running_expected_clp` — what the LEDGER says should be in the drawer right now (opening float + cash taken, reversed payments excluded) — and the takings split by instrument. `session: null` is a 200 and the ordinary morning state, not a 404. Only EFECTIVO counts toward the expectation: a card or a transfer taken at the counter belongs to the shift but never reaches the till.
40000
+ * The Diagnóstico: day N of 30, live numbers, plan band
40001
+ * @description The clinic's free Diagnóstico in one read. `status` is `not_started`, `active` or `closed`; `eligibility` says whether the owner can start one and, if not, why (`reason` + a printable `message`; `available_on` when this clinic's yearly Diagnóstico was already used). `window` is the open window (else the newest closed one) with `day` of `days_total`, `days_left`, and `closing.sentence` — what the last day does: a window that turned the revenue mirror on stops it and deletes the copied detail unless the clinic holds the plan; a window over a mirror that was already on never deletes. `report` is the aggregate reading (the 90 days ending today, from the same engine as `GET /clinic/insights/comercial`) — `live` while the window is open, `stored` once closed; it carries the day-one plan `band` with its price. `formula_status: propuesta` marks the formulas the mentors have not frozen yet. `history` lists past Diagnósticos. Requires `clinic_money:read` or `clinic_insights:read`. Aggregates only — counts, CLP, rates, months and professional names; never a patient, cita, presupuesto or payment. A caller WITHOUT `clinic_money:read` (a Consultor or an app on the insights scope) additionally gets every figure resting on fewer than 5 cases withheld as `null` (`suppression.min_count`) and no deletion-ledger detail.
40002
40002
  *
40003
40003
  * **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
40004
40004
  */
40005
40005
  get: {
40006
40006
  parameters: {
40007
- query: {
40008
- location_id: string;
40009
- };
40007
+ query?: never;
40010
40008
  header?: never;
40011
40009
  path?: never;
40012
40010
  cookie?: never;
40013
40011
  };
40014
40012
  requestBody?: never;
40015
40013
  responses: {
40016
- /** @description The open session, or null */
40014
+ /** @description The Diagnóstico */
40017
40015
  200: {
40018
40016
  headers: {
40019
40017
  [name: string]: unknown;
@@ -40022,37 +40020,169 @@ interface paths {
40022
40020
  /**
40023
40021
  * @example {
40024
40022
  * "data": {
40025
- * "session": {
40026
- * "id": "d1d832c4-0000-4000-8000-000000000001",
40027
- * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
40028
- * "location_id": "b1b1b1b1-0000-4000-8000-000000000002",
40029
- * "opened_by_user_id": "11111111-0000-4000-8000-000000000001",
40030
- * "opened_at": "2026-09-22T22:21:16.863Z",
40031
- * "opening_float_clp": 30000,
40032
- * "closed_by_user_id": null,
40023
+ * "status": "active",
40024
+ * "viewer": {
40025
+ * "may_start": true
40026
+ * },
40027
+ * "eligibility": {
40028
+ * "can_start": false,
40029
+ * "reason": "active",
40030
+ * "message": "Tu Diagnóstico está en curso.",
40031
+ * "available_on": null
40032
+ * },
40033
+ * "window": {
40034
+ * "id": "0192f1c4-7d3a-7b21-9c4e-3f5a6b7c8d9e",
40035
+ * "status": "active",
40036
+ * "phase": "running",
40037
+ * "closing_reason": null,
40038
+ * "held_until": null,
40039
+ * "started_at": "2026-10-05T13:00:00.000Z",
40040
+ * "ends_at": "2026-11-04T13:00:00.000Z",
40041
+ * "day": 12,
40042
+ * "days_total": 30,
40043
+ * "days_left": 19,
40044
+ * "warned_at": null,
40045
+ * "ended_early_at": null,
40033
40046
  * "closed_at": null,
40034
- * "expected_clp": null,
40035
- * "counted_clp": null,
40036
- * "difference_clp": null,
40037
- * "difference_reason": null,
40038
- * "status": "open",
40039
- * "note": "Turno mañana",
40040
- * "created_at": "2026-09-22T22:21:16.863Z",
40041
- * "updated_at": "2026-09-22T22:21:16.863Z",
40042
- * "location_name": "Sucursal Maipú",
40043
- * "running_expected_clp": 30000,
40044
- * "collected_clp": 0,
40045
- * "payments": 0,
40046
- * "by_instrument": []
40047
- * }
40047
+ * "outcome": null,
40048
+ * "mirror_origin": "diagnostico",
40049
+ * "closing": {
40050
+ * "deletes_detail": true,
40051
+ * "sentence": "El 4 de noviembre dejamos de copiar datos y eliminamos el detalle copiado; conservamos solo el informe con tus totales. Con el plan, todo sigue al día."
40052
+ * },
40053
+ * "runs": []
40054
+ * },
40055
+ * "sync": {
40056
+ * "state": "up_to_date",
40057
+ * "synced_at": "2026-10-16T12:03:00.000Z",
40058
+ * "message": null
40059
+ * },
40060
+ * "report": {
40061
+ * "version": 1,
40062
+ * "computed_at": "2026-10-16T12:10:00.000Z",
40063
+ * "from": "2026-07-19",
40064
+ * "to": "2026-10-16",
40065
+ * "data_through": "2026-10-16T12:03:00.000Z",
40066
+ * "state": "ready",
40067
+ * "state_reason": null,
40068
+ * "collected": {
40069
+ * "clp": 48250000,
40070
+ * "previous_clp": 44100000,
40071
+ * "delta_pct": 9.4,
40072
+ * "rule": "Lo cobrado en el período: todos los pagos recibidos, sin los anulados."
40073
+ * },
40074
+ * "acceptance": {
40075
+ * "presented": 212,
40076
+ * "accepted": 97,
40077
+ * "rate": 45.8,
40078
+ * "presented_clp": 186400000,
40079
+ * "accepted_clp": 71900000,
40080
+ * "formula_status": "acordada",
40081
+ * "rule": "Presupuestos aceptados ÷ presupuestos presentados, cada presupuesto una vez."
40082
+ * },
40083
+ * "cierres": {
40084
+ * "count": 81,
40085
+ * "value_clp": 63300000,
40086
+ * "formula_status": "acordada",
40087
+ * "rule": "Un cierre es el primer pago de un presupuesto aceptado."
40088
+ * },
40089
+ * "by_professional": [
40090
+ * {
40091
+ * "professional_id": "0192f1c4-0000-7000-8000-000000000001",
40092
+ * "professional_name": "Dra. Ejemplo",
40093
+ * "presented": 64,
40094
+ * "accepted": 35,
40095
+ * "rate": 54.7,
40096
+ * "accepted_clp": 28100000,
40097
+ * "cierres": 30,
40098
+ * "cierres_clp": 24900000,
40099
+ * "suppressed": false
40100
+ * }
40101
+ * ],
40102
+ * "months": [
40103
+ * {
40104
+ * "month": "2026-09",
40105
+ * "accepted_clp": 24300000,
40106
+ * "produced_clp": 19800000,
40107
+ * "collected_clp": 16900000,
40108
+ * "cierres": 27
40109
+ * }
40110
+ * ],
40111
+ * "first_visit": {
40112
+ * "patients": 140,
40113
+ * "paid": 61,
40114
+ * "rate": 43.6,
40115
+ * "formula_status": "propuesta",
40116
+ * "rule": "Fórmula propuesta, a la espera de los mentores."
40117
+ * },
40118
+ * "second_visit": {
40119
+ * "eligible": 79,
40120
+ * "converted": 22,
40121
+ * "rate": 27.8,
40122
+ * "formula_status": "propuesta",
40123
+ * "rule": "Fórmula propuesta, a la espera de los mentores."
40124
+ * },
40125
+ * "botados": {
40126
+ * "unaccepted": {
40127
+ * "count": 88,
40128
+ * "clp": 74200000,
40129
+ * "suppressed": false
40130
+ * },
40131
+ * "accepted_unscheduled": {
40132
+ * "count": 14,
40133
+ * "clp": 9600000,
40134
+ * "suppressed": false
40135
+ * },
40136
+ * "mid_treatment_no_future_cita": {
40137
+ * "count": 23,
40138
+ * "clp": 12100000,
40139
+ * "suppressed": false
40140
+ * },
40141
+ * "total": {
40142
+ * "count": 125,
40143
+ * "clp": 95900000,
40144
+ * "suppressed": false
40145
+ * },
40146
+ * "focus": "unaccepted",
40147
+ * "formula_status": "propuesta",
40148
+ * "rule": "Fórmula propuesta, a la espera de los mentores."
40149
+ * },
40150
+ * "band": {
40151
+ * "band": "M",
40152
+ * "count": 7.3,
40153
+ * "has_history": true,
40154
+ * "months": [
40155
+ * {
40156
+ * "month": "2026-07",
40157
+ * "count": 7
40158
+ * },
40159
+ * {
40160
+ * "month": "2026-08",
40161
+ * "count": 8
40162
+ * },
40163
+ * {
40164
+ * "month": "2026-09",
40165
+ * "count": 7
40166
+ * }
40167
+ * ],
40168
+ * "uf_month": 3,
40169
+ * "estimated_clp_month": 119000,
40170
+ * "price_label": "UF 3 al mes",
40171
+ * "rule": "Tu tramo se revisa cada mes con el promedio de tus últimos 3 meses; si sube, te avisamos con un mes de anticipación."
40172
+ * }
40173
+ * },
40174
+ * "report_source": "live",
40175
+ * "plan": {
40176
+ * "holds_plan": false,
40177
+ * "status": "none"
40178
+ * },
40179
+ * "history": [],
40180
+ * "suppression": null
40048
40181
  * }
40049
40182
  * }
40050
40183
  */
40051
40184
  "application/json": {
40052
- data?: unknown;
40053
- meta?: {
40054
- [key: string]: unknown;
40055
- };
40185
+ data: components["schemas"]["ClinicDiagnostico"];
40056
40186
  };
40057
40187
  };
40058
40188
  };
@@ -40120,7 +40250,7 @@ interface paths {
40120
40250
  patch?: never;
40121
40251
  trace?: never;
40122
40252
  };
40123
- "/clinic/cash-sessions/open": {
40253
+ "/clinic/cash-sessions/current": {
40124
40254
  parameters: {
40125
40255
  query?: never;
40126
40256
  header?: never;
@@ -40128,21 +40258,23 @@ interface paths {
40128
40258
  cookie?: never;
40129
40259
  };
40130
40260
  /**
40131
- * List every open caja session
40132
- * @description One per sucursal at most — a partial unique index enforces it. What the sidebar badge reads.
40261
+ * The open caja session at a sucursal
40262
+ * @description The shift at `location_id`, with `running_expected_clp` — what the LEDGER says should be in the drawer right now (opening float + cash taken, reversed payments excluded) — and the takings split by instrument. `session: null` is a 200 and the ordinary morning state, not a 404. Only EFECTIVO counts toward the expectation: a card or a transfer taken at the counter belongs to the shift but never reaches the till.
40133
40263
  *
40134
40264
  * **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
40135
40265
  */
40136
40266
  get: {
40137
40267
  parameters: {
40138
- query?: never;
40268
+ query: {
40269
+ location_id: string;
40270
+ };
40139
40271
  header?: never;
40140
40272
  path?: never;
40141
40273
  cookie?: never;
40142
40274
  };
40143
40275
  requestBody?: never;
40144
40276
  responses: {
40145
- /** @description Open sessions */
40277
+ /** @description The open session, or null */
40146
40278
  200: {
40147
40279
  headers: {
40148
40280
  [name: string]: unknown;
@@ -40151,27 +40283,29 @@ interface paths {
40151
40283
  /**
40152
40284
  * @example {
40153
40285
  * "data": {
40154
- * "items": [
40155
- * {
40156
- * "id": "d1d832c4-0000-4000-8000-000000000001",
40157
- * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
40158
- * "location_id": "b1b1b1b1-0000-4000-8000-000000000002",
40159
- * "opened_by_user_id": "11111111-0000-4000-8000-000000000001",
40160
- * "opened_at": "2026-09-22T22:21:16.863Z",
40161
- * "opening_float_clp": 30000,
40162
- * "closed_by_user_id": null,
40163
- * "closed_at": null,
40164
- * "expected_clp": null,
40165
- * "counted_clp": null,
40166
- * "difference_clp": null,
40167
- * "difference_reason": null,
40168
- * "status": "open",
40169
- * "note": "Turno mañana",
40170
- * "created_at": "2026-09-22T22:21:16.863Z",
40171
- * "updated_at": "2026-09-22T22:21:16.863Z",
40172
- * "location_name": "Sucursal Maipú"
40173
- * }
40174
- * ]
40286
+ * "session": {
40287
+ * "id": "d1d832c4-0000-4000-8000-000000000001",
40288
+ * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
40289
+ * "location_id": "b1b1b1b1-0000-4000-8000-000000000002",
40290
+ * "opened_by_user_id": "11111111-0000-4000-8000-000000000001",
40291
+ * "opened_at": "2026-09-22T22:21:16.863Z",
40292
+ * "opening_float_clp": 30000,
40293
+ * "closed_by_user_id": null,
40294
+ * "closed_at": null,
40295
+ * "expected_clp": null,
40296
+ * "counted_clp": null,
40297
+ * "difference_clp": null,
40298
+ * "difference_reason": null,
40299
+ * "status": "open",
40300
+ * "note": "Turno mañana",
40301
+ * "created_at": "2026-09-22T22:21:16.863Z",
40302
+ * "updated_at": "2026-09-22T22:21:16.863Z",
40303
+ * "location_name": "Sucursal Maipú",
40304
+ * "running_expected_clp": 30000,
40305
+ * "collected_clp": 0,
40306
+ * "payments": 0,
40307
+ * "by_instrument": []
40308
+ * }
40175
40309
  * }
40176
40310
  * }
40177
40311
  */
@@ -40247,7 +40381,7 @@ interface paths {
40247
40381
  patch?: never;
40248
40382
  trace?: never;
40249
40383
  };
40250
- "/clinic/cash-sessions": {
40384
+ "/clinic/cash-sessions/open": {
40251
40385
  parameters: {
40252
40386
  query?: never;
40253
40387
  header?: never;
@@ -40255,28 +40389,21 @@ interface paths {
40255
40389
  cookie?: never;
40256
40390
  };
40257
40391
  /**
40258
- * List caja sessions
40259
- * @description The shift history, newest first, each with its expected vs counted and the stored difference (SIGNED: negative is short, positive is over) plus the reason somebody wrote for it. `from`/`to` are inclusive calendar days over the day the drawer was OPENED, so a late close that crossed midnight stays with the shift it belongs to.
40392
+ * List every open caja session
40393
+ * @description One per sucursal at most — a partial unique index enforces it. What the sidebar badge reads.
40260
40394
  *
40261
40395
  * **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
40262
40396
  */
40263
40397
  get: {
40264
40398
  parameters: {
40265
- query?: {
40266
- location_id?: string;
40267
- status?: "open" | "closed" | "reconciled";
40268
- from?: string;
40269
- to?: string;
40270
- limit?: number;
40271
- offset?: number | null;
40272
- };
40399
+ query?: never;
40273
40400
  header?: never;
40274
40401
  path?: never;
40275
40402
  cookie?: never;
40276
40403
  };
40277
40404
  requestBody?: never;
40278
40405
  responses: {
40279
- /** @description Sessions + totals */
40406
+ /** @description Open sessions */
40280
40407
  200: {
40281
40408
  headers: {
40282
40409
  [name: string]: unknown;
@@ -40303,15 +40430,9 @@ interface paths {
40303
40430
  * "note": "Turno mañana",
40304
40431
  * "created_at": "2026-09-22T22:21:16.863Z",
40305
40432
  * "updated_at": "2026-09-22T22:21:16.863Z",
40306
- * "location_name": "Sucursal Maipú",
40307
- * "running_expected_clp": 30000,
40308
- * "collected_clp": 0,
40309
- * "payments": 0,
40310
- * "by_instrument": []
40433
+ * "location_name": "Sucursal Maipú"
40311
40434
  * }
40312
- * ],
40313
- * "count": 1,
40314
- * "difference_clp": 0
40435
+ * ]
40315
40436
  * }
40316
40437
  * }
40317
40438
  */
@@ -40380,42 +40501,44 @@ interface paths {
40380
40501
  };
40381
40502
  };
40382
40503
  put?: never;
40504
+ post?: never;
40505
+ delete?: never;
40506
+ options?: never;
40507
+ head?: never;
40508
+ patch?: never;
40509
+ trace?: never;
40510
+ };
40511
+ "/clinic/cash-sessions": {
40512
+ parameters: {
40513
+ query?: never;
40514
+ header?: never;
40515
+ path?: never;
40516
+ cookie?: never;
40517
+ };
40383
40518
  /**
40384
- * Open the drawer
40385
- * @description One open session per sucursal, enforced by a partial unique index — a second attempt answers 409 rather than creating a parallel shift. Requires a signed-in user: `opened_by_user_id` is NOT NULL because «quién abrió la caja» is the point of a shift, so an api_key principal is refused rather than stored as a null nobody can chase.
40519
+ * List caja sessions
40520
+ * @description The shift history, newest first, each with its expected vs counted and the stored difference (SIGNED: negative is short, positive is over) plus the reason somebody wrote for it. `from`/`to` are inclusive calendar days over the day the drawer was OPENED, so a late close that crossed midnight stays with the shift it belongs to.
40386
40521
  *
40387
40522
  * **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
40388
40523
  */
40389
- post: {
40524
+ get: {
40390
40525
  parameters: {
40391
- query?: never;
40392
- header?: {
40393
- /** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
40394
- "Idempotency-Key"?: string;
40526
+ query?: {
40527
+ location_id?: string;
40528
+ status?: "open" | "closed" | "reconciled";
40529
+ from?: string;
40530
+ to?: string;
40531
+ limit?: number;
40532
+ offset?: number | null;
40395
40533
  };
40534
+ header?: never;
40396
40535
  path?: never;
40397
40536
  cookie?: never;
40398
40537
  };
40399
- requestBody?: {
40400
- content: {
40401
- /**
40402
- * @example {
40403
- * "location_id": "b1b1b1b1-0000-4000-8000-000000000002",
40404
- * "opening_float_clp": 30000,
40405
- * "note": "Turno mañana"
40406
- * }
40407
- */
40408
- "application/json": {
40409
- /** Format: uuid */
40410
- location_id: string;
40411
- opening_float_clp?: number;
40412
- note?: string | null;
40413
- };
40414
- };
40415
- };
40538
+ requestBody?: never;
40416
40539
  responses: {
40417
- /** @description Caja session */
40418
- 201: {
40540
+ /** @description Sessions + totals */
40541
+ 200: {
40419
40542
  headers: {
40420
40543
  [name: string]: unknown;
40421
40544
  };
@@ -40423,27 +40546,165 @@ interface paths {
40423
40546
  /**
40424
40547
  * @example {
40425
40548
  * "data": {
40426
- * "id": "d1d832c4-0000-4000-8000-000000000001",
40427
- * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
40428
- * "location_id": "b1b1b1b1-0000-4000-8000-000000000002",
40429
- * "opened_by_user_id": "11111111-0000-4000-8000-000000000001",
40430
- * "opened_at": "2026-09-22T22:21:16.863Z",
40431
- * "opening_float_clp": 30000,
40432
- * "closed_by_user_id": null,
40433
- * "closed_at": null,
40434
- * "expected_clp": null,
40435
- * "counted_clp": null,
40436
- * "difference_clp": null,
40437
- * "difference_reason": null,
40438
- * "status": "open",
40439
- * "note": "Turno mañana",
40440
- * "created_at": "2026-09-22T22:21:16.863Z",
40441
- * "updated_at": "2026-09-22T22:21:16.863Z",
40442
- * "location_name": "Sucursal Maipú",
40443
- * "running_expected_clp": 30000,
40444
- * "collected_clp": 0,
40445
- * "payments": 0,
40446
- * "by_instrument": []
40549
+ * "items": [
40550
+ * {
40551
+ * "id": "d1d832c4-0000-4000-8000-000000000001",
40552
+ * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
40553
+ * "location_id": "b1b1b1b1-0000-4000-8000-000000000002",
40554
+ * "opened_by_user_id": "11111111-0000-4000-8000-000000000001",
40555
+ * "opened_at": "2026-09-22T22:21:16.863Z",
40556
+ * "opening_float_clp": 30000,
40557
+ * "closed_by_user_id": null,
40558
+ * "closed_at": null,
40559
+ * "expected_clp": null,
40560
+ * "counted_clp": null,
40561
+ * "difference_clp": null,
40562
+ * "difference_reason": null,
40563
+ * "status": "open",
40564
+ * "note": "Turno mañana",
40565
+ * "created_at": "2026-09-22T22:21:16.863Z",
40566
+ * "updated_at": "2026-09-22T22:21:16.863Z",
40567
+ * "location_name": "Sucursal Maipú",
40568
+ * "running_expected_clp": 30000,
40569
+ * "collected_clp": 0,
40570
+ * "payments": 0,
40571
+ * "by_instrument": []
40572
+ * }
40573
+ * ],
40574
+ * "count": 1,
40575
+ * "difference_clp": 0
40576
+ * }
40577
+ * }
40578
+ */
40579
+ "application/json": {
40580
+ data?: unknown;
40581
+ meta?: {
40582
+ [key: string]: unknown;
40583
+ };
40584
+ };
40585
+ };
40586
+ };
40587
+ /** @description Validation error */
40588
+ 400: {
40589
+ headers: {
40590
+ [name: string]: unknown;
40591
+ };
40592
+ content: {
40593
+ "application/json": components["schemas"]["Error"];
40594
+ };
40595
+ };
40596
+ /** @description Unauthorized */
40597
+ 401: {
40598
+ headers: {
40599
+ [name: string]: unknown;
40600
+ };
40601
+ content: {
40602
+ "application/json": components["schemas"]["Error"];
40603
+ };
40604
+ };
40605
+ /** @description Forbidden */
40606
+ 403: {
40607
+ headers: {
40608
+ [name: string]: unknown;
40609
+ };
40610
+ content: {
40611
+ "application/json": components["schemas"]["Error"];
40612
+ };
40613
+ };
40614
+ /** @description Not found */
40615
+ 404: {
40616
+ headers: {
40617
+ [name: string]: unknown;
40618
+ };
40619
+ content: {
40620
+ "application/json": components["schemas"]["Error"];
40621
+ };
40622
+ };
40623
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
40624
+ 409: {
40625
+ headers: {
40626
+ [name: string]: unknown;
40627
+ };
40628
+ content: {
40629
+ "application/json": components["schemas"]["Error"];
40630
+ };
40631
+ };
40632
+ /** @description Rate limited */
40633
+ 429: {
40634
+ headers: {
40635
+ [name: string]: unknown;
40636
+ };
40637
+ content: {
40638
+ "application/json": components["schemas"]["Error"];
40639
+ };
40640
+ };
40641
+ };
40642
+ };
40643
+ put?: never;
40644
+ /**
40645
+ * Open the drawer
40646
+ * @description One open session per sucursal, enforced by a partial unique index — a second attempt answers 409 rather than creating a parallel shift. Requires a signed-in user: `opened_by_user_id` is NOT NULL because «quién abrió la caja» is the point of a shift, so an api_key principal is refused rather than stored as a null nobody can chase.
40647
+ *
40648
+ * **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
40649
+ */
40650
+ post: {
40651
+ parameters: {
40652
+ query?: never;
40653
+ header?: {
40654
+ /** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
40655
+ "Idempotency-Key"?: string;
40656
+ };
40657
+ path?: never;
40658
+ cookie?: never;
40659
+ };
40660
+ requestBody?: {
40661
+ content: {
40662
+ /**
40663
+ * @example {
40664
+ * "location_id": "b1b1b1b1-0000-4000-8000-000000000002",
40665
+ * "opening_float_clp": 30000,
40666
+ * "note": "Turno mañana"
40667
+ * }
40668
+ */
40669
+ "application/json": {
40670
+ /** Format: uuid */
40671
+ location_id: string;
40672
+ opening_float_clp?: number;
40673
+ note?: string | null;
40674
+ };
40675
+ };
40676
+ };
40677
+ responses: {
40678
+ /** @description Caja session */
40679
+ 201: {
40680
+ headers: {
40681
+ [name: string]: unknown;
40682
+ };
40683
+ content: {
40684
+ /**
40685
+ * @example {
40686
+ * "data": {
40687
+ * "id": "d1d832c4-0000-4000-8000-000000000001",
40688
+ * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
40689
+ * "location_id": "b1b1b1b1-0000-4000-8000-000000000002",
40690
+ * "opened_by_user_id": "11111111-0000-4000-8000-000000000001",
40691
+ * "opened_at": "2026-09-22T22:21:16.863Z",
40692
+ * "opening_float_clp": 30000,
40693
+ * "closed_by_user_id": null,
40694
+ * "closed_at": null,
40695
+ * "expected_clp": null,
40696
+ * "counted_clp": null,
40697
+ * "difference_clp": null,
40698
+ * "difference_reason": null,
40699
+ * "status": "open",
40700
+ * "note": "Turno mañana",
40701
+ * "created_at": "2026-09-22T22:21:16.863Z",
40702
+ * "updated_at": "2026-09-22T22:21:16.863Z",
40703
+ * "location_name": "Sucursal Maipú",
40704
+ * "running_expected_clp": 30000,
40705
+ * "collected_clp": 0,
40706
+ * "payments": 0,
40707
+ * "by_instrument": []
40447
40708
  * }
40448
40709
  * }
40449
40710
  */
@@ -66863,7 +67124,7 @@ interface paths {
66863
67124
  };
66864
67125
  /**
66865
67126
  * Commercial numbers: presupuesto acceptance, cierres, cash, botados
66866
- * @description The clinic's commercial numbers, aggregates only (counts, CLP, percentages, months and professional names; never a patient). `regime` says how acceptance is read: `evidencia` when the revenue mirror is on (a non-entry line performed, or a cita booked after the presupuesto, inside its window), `explicita` otherwise (the acceptance the clinic recorded). Acceptance is by COUNT of presupuestos, one per lineage; $0 and entry-only presupuestos are out of both sides; the window is 60 days (90 for ortodoncia and implantología); the rate goes to the professional who issued the presupuesto. Presupuestos ISSUED in the window form the acceptance cohort (`cohorts` by issue month with 30- and 60-day reads). A cierre is the first payment on an accepted presupuesto: once per presupuesto, dated on that payment, valued at the full accepted value. `headline` is the cash collected in the window against the previous window of the same length. `first_visit`, `second_visit` and `botados` carry `formula: propuesta`; `botados` is a live worklist over the last six months. Every KPI carries its `formula` and a printable `rule`; a rate with no denominator is `null`, never 0. `state` is `empty`, `settling` (presupuesto lines still being read; `state_reason` says so) or `ready`. Requires `clinic_money:read` (or `clinic_insights:read`, which reads the same aggregates). Accepts `from` / `to` (bare `YYYY-MM-DD`, `to` INCLUSIVE; default the 90 days ending today in the clinic's zone), `location_id` and `professional_id`. With `professional_id`, cash (`headline`, `months[].collected_clp`) is `null`: a payment belongs to the patient, not to a professional.
67127
+ * @description The clinic's commercial numbers, aggregates only (counts, CLP, percentages, months and professional names; never a patient). `regime` says how acceptance is read: `evidencia` when the revenue mirror is on (a non-entry line performed, or a cita booked after the presupuesto, inside its window), `explicita` otherwise (the acceptance the clinic recorded). Acceptance is by COUNT of presupuestos, one per lineage; $0 and entry-only presupuestos are out of both sides; the window is 60 days (90 for ortodoncia and implantología); the rate goes to the professional who issued the presupuesto. Presupuestos ISSUED in the window form the acceptance cohort (`cohorts` by issue month with 30- and 60-day reads). A cierre is the first payment on an accepted presupuesto: once per presupuesto, dated on that payment, valued at the full accepted value. `headline` is the cash collected in the window against the previous window of the same length. `first_visit`, `second_visit` and `botados` carry `formula: propuesta`; `botados` is a live worklist over the last six months. Every KPI carries its `formula` and a printable `rule`; a rate with no denominator is `null`, never 0. `state` is `empty`, `settling` (presupuesto lines still being read; `state_reason` says so) or `ready`. Requires `clinic_money:read` (or `clinic_insights:read`, which reads the same aggregates). Accepts `from` / `to` (bare `YYYY-MM-DD`, `to` INCLUSIVE; default the 90 days ending today in the clinic's zone), `location_id` and `professional_id`. With `professional_id`, cash (`headline`, `months[].collected_clp`) is `null`: a payment belongs to the patient, not to a professional. A caller WITHOUT `clinic_money:read` always reads one fixed window — the last 3 closed calendar months — whatever range or filter it asks (`suppression.filters_ignored`), with every count or CLP resting on 1–4 cases `null`, rates over fewer than 5 cases `null`, complementary suppression over professionals, cohorts and botados lists, and month rows carrying only cash.
66867
67128
  *
66868
67129
  * **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
66869
67130
  */
@@ -73596,6 +73857,8 @@ interface paths {
73596
73857
  *
73597
73858
  * Each row also carries `marketplaceWindow` — `{ open, closedAt, closedReason, lastEvent, lastEventReason, lastEventAt }` on a `facebook_marketplace` conversation, `null` on every other channel. `open` is whether a reply typed in Vitrina can be delivered right now.
73598
73859
  *
73860
+ * Each row also carries `ad_origin` (the `AdOrigin` schema) — the Meta ad that opened the thread, in ONE shape whatever the channel (click-to-WhatsApp or an Instagram DM ad), or `null` for an organic thread. `platform` is the thread channel; `ad_external_id` is Meta's ad id (`null` for a boosted post); `ad_name` and `campaign_name` are `null` when the Ads read does not know them; `title` is the ADVERTISER'S copy, never the customer's words; `thumbnail_url` is Vitrina's durable copy of the creative when `media_archived` is `true`, else Meta's own link, which expires — render it with a fallback; `captured_at` is when the thread opened. Meta's own object stays on `ad_referral`, verbatim and write-once, in the channel's spelling (`source_id`/`ctwa_clid` on WhatsApp; `source: 'ADS'`, `ad_id`, `ads_context_data` on Instagram).
73861
+ *
73599
73862
  * Rows here do NOT carry `ad_origin_nudge` — that field is single-conversation-read only, to avoid a per-row integration lookup on every page of the inbox.
73600
73863
  */
73601
73864
  get: {
@@ -73751,6 +74014,7 @@ interface paths {
73751
74014
  * "created_at": "2026-09-22T11:08:10.882Z"
73752
74015
  * },
73753
74016
  * "marketplaceWindow": null,
74017
+ * "ad_origin": null,
73754
74018
  * "tags": [
73755
74019
  * {
73756
74020
  * "id": "12121212-0000-4000-8000-000000000001",
@@ -73759,6 +74023,142 @@ interface paths {
73759
74023
  * }
73760
74024
  * ],
73761
74025
  * "last_call": null
74026
+ * },
74027
+ * {
74028
+ * "id": "bbbbbbbb-0000-4000-8000-000000000002",
74029
+ * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
74030
+ * "display_seq": 133,
74031
+ * "display_id": "C-133",
74032
+ * "channel": "instagram",
74033
+ * "external_id": "<instagram-scoped-id>",
74034
+ * "messaging_account_id": "16161616-0000-4000-8000-000000000001",
74035
+ * "brand": null,
74036
+ * "contact_id": "22222222-0000-4000-8000-000000000001",
74037
+ * "ticket_id": null,
74038
+ * "status": "open",
74039
+ * "handler": "bot",
74040
+ * "assignee_user_id": null,
74041
+ * "assignee_assigned_at": null,
74042
+ * "snoozed_until": null,
74043
+ * "resolved_at": null,
74044
+ * "resolved_by": null,
74045
+ * "closed_at": null,
74046
+ * "close_deferred_until": null,
74047
+ * "transfer_immediately": false,
74048
+ * "filtered_at": null,
74049
+ * "filtered_reason": null,
74050
+ * "summary": null,
74051
+ * "summarized_at": null,
74052
+ * "history_summary": null,
74053
+ * "history_summary_upto_message_id": null,
74054
+ * "first_billable_at": null,
74055
+ * "billable": null,
74056
+ * "billing_reason": null,
74057
+ * "assigned_unanswered_alerted_at": null,
74058
+ * "assigned_unanswered_realerted_at": null,
74059
+ * "bot_gate_override_at": null,
74060
+ * "bot_gate_override_by": null,
74061
+ * "source": null,
74062
+ * "awaiting_human_since": null,
74063
+ * "awaiting_payment_since": null,
74064
+ * "awaiting_payment_escalated_at": null,
74065
+ * "awaiting_obligation_id": null,
74066
+ * "ad_referral": {
74067
+ * "ref": null,
74068
+ * "source": "ADS",
74069
+ * "type": "OPEN_THREAD",
74070
+ * "ad_id": "120236000000000001",
74071
+ * "ads_context_data": {
74072
+ * "ad_title": "Evaluación sin costo este mes",
74073
+ * "photo_url": null,
74074
+ * "video_url": "https://lookaside.fbsbx.com/ig_messaging_cdn/?asset_id=<asset>",
74075
+ * "post_id": "18000000000000001",
74076
+ * "product_id": null
74077
+ * }
74078
+ * },
74079
+ * "ad_join": null,
74080
+ * "ad_welcome": null,
74081
+ * "metadata": {
74082
+ * "ad_creative": {
74083
+ * "thumbnail_url": "https://media.vitrinadev.com/ad-creatives/a1a1a1a1-0000-4000-8000-000000000001/<digest>.jpg",
74084
+ * "source": "share_media",
74085
+ * "permalink": "https://www.instagram.com/p/<shortcode>/",
74086
+ * "archived_at": "2026-09-22T10:42:15.120Z"
74087
+ * }
74088
+ * },
74089
+ * "ai_control_source": "legacy",
74090
+ * "ai_control_changed_at": null,
74091
+ * "ai_control_revision": 0,
74092
+ * "ai_control_window_start": null,
74093
+ * "ai_control_window_end": null,
74094
+ * "ai_control_account_revision": null,
74095
+ * "ai_blocked_until": null,
74096
+ * "ai_keep_with_human": false,
74097
+ * "external_id_provisional": false,
74098
+ * "originated_at": null,
74099
+ * "originated_by_kind": null,
74100
+ * "originated_by_ai_agent_id": null,
74101
+ * "originated_by_user_id": null,
74102
+ * "originated_outbound_action_id": null,
74103
+ * "last_message_date": "2026-09-22T10:41:12.310Z",
74104
+ * "created_at": "2026-09-22T10:41:12.004Z",
74105
+ * "updated_at": "2026-09-22T10:41:12.310Z",
74106
+ * "contact": {
74107
+ * "id": "22222222-0000-4000-8000-000000000001",
74108
+ * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
74109
+ * "name": "Rodrigo Pizarro",
74110
+ * "email": "rodrigo.pizarro@example.cl",
74111
+ * "phone": "+56977000021",
74112
+ * "external_id": "web:visitor-9f2c1a",
74113
+ * "avatar_url": null,
74114
+ * "city": null,
74115
+ * "country": null,
74116
+ * "language": "es",
74117
+ * "job_title": null,
74118
+ * "company_id": null,
74119
+ * "brand": null,
74120
+ * "social": {},
74121
+ * "social_stats": {},
74122
+ * "lifecycle_stage": "unknown",
74123
+ * "email_status": "subscribed",
74124
+ * "email_consent": false,
74125
+ * "outreach_consent_at": null,
74126
+ * "outreach_consent_source_url": null,
74127
+ * "outreach_consent_text_version": null,
74128
+ * "bot_replies_disabled_at": null,
74129
+ * "bot_replies_disabled_by": null,
74130
+ * "spam_at": null,
74131
+ * "blocked_at": null,
74132
+ * "archived_at": null,
74133
+ * "merged_at": null,
74134
+ * "merged_into_contact_id": null,
74135
+ * "search_text": "rodrigo pizarro rodrigo.pizarro@example.cl +56977000021",
74136
+ * "created_at": "2026-09-22T11:06:33.508Z",
74137
+ * "updated_at": "2026-09-22T11:06:33.508Z"
74138
+ * },
74139
+ * "ticket": null,
74140
+ * "lastMessage": {
74141
+ * "id": "eeeeeeee-0000-4000-8000-000000000001",
74142
+ * "content": "Hola, quiero más información",
74143
+ * "sender_type": "contact",
74144
+ * "created_at": "2026-09-22T10:41:12.310Z"
74145
+ * },
74146
+ * "marketplaceWindow": null,
74147
+ * "ad_origin": {
74148
+ * "platform": "instagram",
74149
+ * "kind": "ad",
74150
+ * "ad_external_id": "120236000000000001",
74151
+ * "ad_name": "Evaluación facial — septiembre",
74152
+ * "campaign_name": "Mensajes Instagram · Evaluación",
74153
+ * "title": "Evaluación sin costo este mes",
74154
+ * "thumbnail_url": "https://media.vitrinadev.com/ad-creatives/a1a1a1a1-0000-4000-8000-000000000001/<digest>.jpg",
74155
+ * "media_archived": true,
74156
+ * "video_url": "https://lookaside.fbsbx.com/ig_messaging_cdn/?asset_id=<asset>",
74157
+ * "source_url": "https://www.instagram.com/p/<shortcode>/",
74158
+ * "captured_at": "2026-09-22T10:41:12.004Z"
74159
+ * },
74160
+ * "tags": [],
74161
+ * "last_call": null
73762
74162
  * }
73763
74163
  * ],
73764
74164
  * "meta": {
@@ -73780,7 +74180,9 @@ interface paths {
73780
74180
  * }
73781
74181
  */
73782
74182
  "application/json": {
73783
- data?: unknown;
74183
+ data: {
74184
+ ad_origin: components["schemas"]["AdOrigin"];
74185
+ }[];
73784
74186
  meta?: {
73785
74187
  [key: string]: unknown;
73786
74188
  };
@@ -74159,7 +74561,11 @@ interface paths {
74159
74561
  *
74160
74562
  * Pass `?exclude=messages` to opt into the SAME row without that embed. Any caller that re-reads this on a clock should: the embed has no limit, so a two-year-old thread returns two years of messages every time. `GET /conversations/{id}/messages` pages them properly.
74161
74563
  *
74162
- * Also carries `ad_origin_nudge: 'connect_meta_ads' | null`, non-null ONLY when the caller holds `integrations:write`, the conversation came from a Meta click-to-WhatsApp ad, and the workspace has no connected `meta_ads` integration. THIS ROUTE ONLY — deliberately absent from the list, where the predicate would be an N+1.
74564
+ * Also carries `ad_origin_nudge: 'connect_meta_ads' | null`, non-null ONLY when the caller holds `integrations:write`, the conversation came from a Meta ad (click-to-WhatsApp or an Instagram DM ad), and the workspace has no connected `meta_ads` integration. THIS ROUTE ONLY — deliberately absent from the list, where the predicate would be an N+1.
74565
+ *
74566
+ * And `handoff_resolved_suggested: boolean` (#2968) — true only on an open/pending AI-handoff thread whose customer is still waiting on us AND Jev already read their own pending words as saying the matter is resolved (checked once per customer message, at the next handoff re-notify tick). The inbox reads this to offer a one-click close. THIS ROUTE ONLY, same N+1 reasoning as `ad_origin_nudge`.
74567
+ *
74568
+ * Carries `ad_origin` exactly as `GET /conversations` rows do.
74163
74569
  */
74164
74570
  get: {
74165
74571
  parameters: {
@@ -74291,6 +74697,7 @@ interface paths {
74291
74697
  * "created_at": "2026-09-22T11:08:10.882Z"
74292
74698
  * },
74293
74699
  * "marketplaceWindow": null,
74700
+ * "ad_origin": null,
74294
74701
  * "tags": [
74295
74702
  * {
74296
74703
  * "id": "12121212-0000-4000-8000-000000000001",
@@ -74300,6 +74707,7 @@ interface paths {
74300
74707
  * ],
74301
74708
  * "last_call": null,
74302
74709
  * "ad_origin_nudge": null,
74710
+ * "handoff_resolved_suggested": false,
74303
74711
  * "message": [
74304
74712
  * {
74305
74713
  * "id": "eeeeeeee-0000-4000-8000-000000000001",
@@ -74316,7 +74724,9 @@ interface paths {
74316
74724
  * }
74317
74725
  */
74318
74726
  "application/json": {
74319
- data?: unknown;
74727
+ data: {
74728
+ ad_origin: components["schemas"]["AdOrigin"];
74729
+ };
74320
74730
  meta?: {
74321
74731
  [key: string]: unknown;
74322
74732
  };
@@ -92783,7 +93193,7 @@ interface paths {
92783
93193
  * },
92784
93194
  * "lines": [
92785
93195
  * {
92786
- * "text": "La mejor campaña fue «Evaluación sin costo · Meta», con 5,4× de retorno, y 36,4% de tus tratamientos vino de anuncios.",
93196
+ * "text": "La mejor campaña fue «Evaluación sin costo · Meta», con 5,4× de retorno, y el 36,4% de tus tratamientos llegó desde anuncios.",
92787
93197
  * "fact_keys": [
92788
93198
  * "best_campaign_name",
92789
93199
  * "best_campaign_roas",
@@ -92927,15 +93337,428 @@ interface paths {
92927
93337
  };
92928
93338
  };
92929
93339
  };
92930
- put?: never;
92931
- post?: never;
92932
- delete?: never;
93340
+ put?: never;
93341
+ post?: never;
93342
+ delete?: never;
93343
+ options?: never;
93344
+ head?: never;
93345
+ patch?: never;
93346
+ trace?: never;
93347
+ };
93348
+ "/ads/goal": {
93349
+ parameters: {
93350
+ query?: never;
93351
+ header?: never;
93352
+ path?: never;
93353
+ cookie?: never;
93354
+ };
93355
+ /**
93356
+ * The workspace’s monthly Ads goal
93357
+ * @description The goal the Ads hero measures pace against — results from ads, attributed value or return for the calendar month — or `null` when none is set. With `sample=1` answers the sample dataset’s goal.
93358
+ */
93359
+ get: {
93360
+ parameters: {
93361
+ query?: {
93362
+ /** @description `1` serves the deterministic sample dataset («Ver con datos de ejemplo»): same shapes, invented but internally consistent figures, no entitlement required (the scope still is). A sandbox workspace is always served the sample, with or without this parameter. */
93363
+ sample?: "1" | "true";
93364
+ };
93365
+ header?: never;
93366
+ path?: never;
93367
+ cookie?: never;
93368
+ };
93369
+ requestBody?: never;
93370
+ responses: {
93371
+ /** @description The goal, or `null` */
93372
+ 200: {
93373
+ headers: {
93374
+ [name: string]: unknown;
93375
+ };
93376
+ content: {
93377
+ /**
93378
+ * @example {
93379
+ * "data": {
93380
+ * "kind": "outcomes",
93381
+ * "target": 30,
93382
+ * "period": "month",
93383
+ * "updated_at": "2026-09-01T12:00:00.000Z",
93384
+ * "updated_by": "20000000-0000-4000-8000-000000000001"
93385
+ * }
93386
+ * }
93387
+ */
93388
+ "application/json": {
93389
+ data: components["schemas"]["AdsGoal"];
93390
+ };
93391
+ };
93392
+ };
93393
+ /** @description Validation error */
93394
+ 400: {
93395
+ headers: {
93396
+ [name: string]: unknown;
93397
+ };
93398
+ content: {
93399
+ "application/json": components["schemas"]["Error"];
93400
+ };
93401
+ };
93402
+ /** @description Unauthorized */
93403
+ 401: {
93404
+ headers: {
93405
+ [name: string]: unknown;
93406
+ };
93407
+ content: {
93408
+ "application/json": components["schemas"]["Error"];
93409
+ };
93410
+ };
93411
+ /** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
93412
+ 402: {
93413
+ headers: {
93414
+ [name: string]: unknown;
93415
+ };
93416
+ content: {
93417
+ /**
93418
+ * @example {
93419
+ * "error": {
93420
+ * "code": "ENTITLEMENT_NOT_ACTIVE",
93421
+ * "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
93422
+ * "details": {
93423
+ * "required": [
93424
+ * "vitrina_ads"
93425
+ * ],
93426
+ * "active": [],
93427
+ * "feature": "vitrina_ads",
93428
+ * "entitlement_state": "off"
93429
+ * }
93430
+ * }
93431
+ * }
93432
+ */
93433
+ "application/json": components["schemas"]["Error"];
93434
+ };
93435
+ };
93436
+ /** @description Forbidden */
93437
+ 403: {
93438
+ headers: {
93439
+ [name: string]: unknown;
93440
+ };
93441
+ content: {
93442
+ "application/json": components["schemas"]["Error"];
93443
+ };
93444
+ };
93445
+ /** @description Not found */
93446
+ 404: {
93447
+ headers: {
93448
+ [name: string]: unknown;
93449
+ };
93450
+ content: {
93451
+ "application/json": components["schemas"]["Error"];
93452
+ };
93453
+ };
93454
+ /** @description Vitrina Ads is active but the delegated key has not finished rotating (`ADS_KEY_NEEDS_REMINT`) — retry once `GET /ads/state` reports `needs_remint: false`. Also the generic conflict of a write. */
93455
+ 409: {
93456
+ headers: {
93457
+ [name: string]: unknown;
93458
+ };
93459
+ content: {
93460
+ /**
93461
+ * @example {
93462
+ * "error": {
93463
+ * "code": "ADS_KEY_NEEDS_REMINT",
93464
+ * "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
93465
+ * "details": {
93466
+ * "key_kind": "core"
93467
+ * }
93468
+ * }
93469
+ * }
93470
+ */
93471
+ "application/json": components["schemas"]["Error"];
93472
+ };
93473
+ };
93474
+ /** @description Rate limited */
93475
+ 429: {
93476
+ headers: {
93477
+ [name: string]: unknown;
93478
+ };
93479
+ content: {
93480
+ "application/json": components["schemas"]["Error"];
93481
+ };
93482
+ };
93483
+ };
93484
+ };
93485
+ /**
93486
+ * Set the monthly Ads goal
93487
+ * @description Replaces the goal. `target` > 0; a `roas` goal is at most 100, a `value` goal at most 10^10 CLP, an `outcomes` goal a whole number. The server stamps `updated_at`/`updated_by`. With `sample=1` the goal is validated and echoed with `persisted: false`, never stored.
93488
+ */
93489
+ put: {
93490
+ parameters: {
93491
+ query?: {
93492
+ /** @description `1` serves the deterministic sample dataset («Ver con datos de ejemplo»): same shapes, invented but internally consistent figures, no entitlement required (the scope still is). A sandbox workspace is always served the sample, with or without this parameter. */
93493
+ sample?: "1" | "true";
93494
+ };
93495
+ header?: never;
93496
+ path?: never;
93497
+ cookie?: never;
93498
+ };
93499
+ requestBody: {
93500
+ content: {
93501
+ /**
93502
+ * @example {
93503
+ * "kind": "outcomes",
93504
+ * "target": 30,
93505
+ * "period": "month"
93506
+ * }
93507
+ */
93508
+ "application/json": {
93509
+ /**
93510
+ * @description `outcomes` = results from ads this month; `value` = attributed value (CLP); `roas` = return (×).
93511
+ * @enum {string}
93512
+ */
93513
+ kind: "outcomes" | "value" | "roas";
93514
+ /** @description The month’s target. `roas` ≤ 100; `value` ≤ 10^10; `outcomes` ≤ 10^6. */
93515
+ target: number;
93516
+ /**
93517
+ * @description The only period: the calendar month.
93518
+ * @enum {string}
93519
+ */
93520
+ period: "month";
93521
+ };
93522
+ };
93523
+ };
93524
+ responses: {
93525
+ /** @description The stored goal */
93526
+ 200: {
93527
+ headers: {
93528
+ [name: string]: unknown;
93529
+ };
93530
+ content: {
93531
+ /**
93532
+ * @example {
93533
+ * "data": {
93534
+ * "kind": "outcomes",
93535
+ * "target": 30,
93536
+ * "period": "month",
93537
+ * "updated_at": "2026-09-23T15:00:00.000Z",
93538
+ * "updated_by": "20000000-0000-4000-8000-000000000001",
93539
+ * "persisted": true
93540
+ * }
93541
+ * }
93542
+ */
93543
+ "application/json": {
93544
+ data: components["schemas"]["AdsGoal"] & Record<string, never>;
93545
+ };
93546
+ };
93547
+ };
93548
+ /** @description Validation error */
93549
+ 400: {
93550
+ headers: {
93551
+ [name: string]: unknown;
93552
+ };
93553
+ content: {
93554
+ "application/json": components["schemas"]["Error"];
93555
+ };
93556
+ };
93557
+ /** @description Unauthorized */
93558
+ 401: {
93559
+ headers: {
93560
+ [name: string]: unknown;
93561
+ };
93562
+ content: {
93563
+ "application/json": components["schemas"]["Error"];
93564
+ };
93565
+ };
93566
+ /** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
93567
+ 402: {
93568
+ headers: {
93569
+ [name: string]: unknown;
93570
+ };
93571
+ content: {
93572
+ /**
93573
+ * @example {
93574
+ * "error": {
93575
+ * "code": "ENTITLEMENT_NOT_ACTIVE",
93576
+ * "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
93577
+ * "details": {
93578
+ * "required": [
93579
+ * "vitrina_ads"
93580
+ * ],
93581
+ * "active": [],
93582
+ * "feature": "vitrina_ads",
93583
+ * "entitlement_state": "off"
93584
+ * }
93585
+ * }
93586
+ * }
93587
+ */
93588
+ "application/json": components["schemas"]["Error"];
93589
+ };
93590
+ };
93591
+ /** @description Forbidden */
93592
+ 403: {
93593
+ headers: {
93594
+ [name: string]: unknown;
93595
+ };
93596
+ content: {
93597
+ "application/json": components["schemas"]["Error"];
93598
+ };
93599
+ };
93600
+ /** @description Not found */
93601
+ 404: {
93602
+ headers: {
93603
+ [name: string]: unknown;
93604
+ };
93605
+ content: {
93606
+ "application/json": components["schemas"]["Error"];
93607
+ };
93608
+ };
93609
+ /** @description Vitrina Ads is active but the delegated key has not finished rotating (`ADS_KEY_NEEDS_REMINT`) — retry once `GET /ads/state` reports `needs_remint: false`. Also the generic conflict of a write. */
93610
+ 409: {
93611
+ headers: {
93612
+ [name: string]: unknown;
93613
+ };
93614
+ content: {
93615
+ /**
93616
+ * @example {
93617
+ * "error": {
93618
+ * "code": "ADS_KEY_NEEDS_REMINT",
93619
+ * "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
93620
+ * "details": {
93621
+ * "key_kind": "core"
93622
+ * }
93623
+ * }
93624
+ * }
93625
+ */
93626
+ "application/json": components["schemas"]["Error"];
93627
+ };
93628
+ };
93629
+ /** @description Rate limited */
93630
+ 429: {
93631
+ headers: {
93632
+ [name: string]: unknown;
93633
+ };
93634
+ content: {
93635
+ "application/json": components["schemas"]["Error"];
93636
+ };
93637
+ };
93638
+ };
93639
+ };
93640
+ post?: never;
93641
+ /**
93642
+ * Clear the monthly Ads goal
93643
+ * @description Removes the goal. Idempotent. With `sample=1` nothing is stored or removed.
93644
+ */
93645
+ delete: {
93646
+ parameters: {
93647
+ query?: {
93648
+ /** @description `1` serves the deterministic sample dataset («Ver con datos de ejemplo»): same shapes, invented but internally consistent figures, no entitlement required (the scope still is). A sandbox workspace is always served the sample, with or without this parameter. */
93649
+ sample?: "1" | "true";
93650
+ };
93651
+ header?: never;
93652
+ path?: never;
93653
+ cookie?: never;
93654
+ };
93655
+ requestBody?: never;
93656
+ responses: {
93657
+ /** @description Cleared */
93658
+ 204: {
93659
+ headers: {
93660
+ [name: string]: unknown;
93661
+ };
93662
+ content?: never;
93663
+ };
93664
+ /** @description Validation error */
93665
+ 400: {
93666
+ headers: {
93667
+ [name: string]: unknown;
93668
+ };
93669
+ content: {
93670
+ "application/json": components["schemas"]["Error"];
93671
+ };
93672
+ };
93673
+ /** @description Unauthorized */
93674
+ 401: {
93675
+ headers: {
93676
+ [name: string]: unknown;
93677
+ };
93678
+ content: {
93679
+ "application/json": components["schemas"]["Error"];
93680
+ };
93681
+ };
93682
+ /** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
93683
+ 402: {
93684
+ headers: {
93685
+ [name: string]: unknown;
93686
+ };
93687
+ content: {
93688
+ /**
93689
+ * @example {
93690
+ * "error": {
93691
+ * "code": "ENTITLEMENT_NOT_ACTIVE",
93692
+ * "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
93693
+ * "details": {
93694
+ * "required": [
93695
+ * "vitrina_ads"
93696
+ * ],
93697
+ * "active": [],
93698
+ * "feature": "vitrina_ads",
93699
+ * "entitlement_state": "off"
93700
+ * }
93701
+ * }
93702
+ * }
93703
+ */
93704
+ "application/json": components["schemas"]["Error"];
93705
+ };
93706
+ };
93707
+ /** @description Forbidden */
93708
+ 403: {
93709
+ headers: {
93710
+ [name: string]: unknown;
93711
+ };
93712
+ content: {
93713
+ "application/json": components["schemas"]["Error"];
93714
+ };
93715
+ };
93716
+ /** @description Not found */
93717
+ 404: {
93718
+ headers: {
93719
+ [name: string]: unknown;
93720
+ };
93721
+ content: {
93722
+ "application/json": components["schemas"]["Error"];
93723
+ };
93724
+ };
93725
+ /** @description Vitrina Ads is active but the delegated key has not finished rotating (`ADS_KEY_NEEDS_REMINT`) — retry once `GET /ads/state` reports `needs_remint: false`. Also the generic conflict of a write. */
93726
+ 409: {
93727
+ headers: {
93728
+ [name: string]: unknown;
93729
+ };
93730
+ content: {
93731
+ /**
93732
+ * @example {
93733
+ * "error": {
93734
+ * "code": "ADS_KEY_NEEDS_REMINT",
93735
+ * "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
93736
+ * "details": {
93737
+ * "key_kind": "core"
93738
+ * }
93739
+ * }
93740
+ * }
93741
+ */
93742
+ "application/json": components["schemas"]["Error"];
93743
+ };
93744
+ };
93745
+ /** @description Rate limited */
93746
+ 429: {
93747
+ headers: {
93748
+ [name: string]: unknown;
93749
+ };
93750
+ content: {
93751
+ "application/json": components["schemas"]["Error"];
93752
+ };
93753
+ };
93754
+ };
93755
+ };
92933
93756
  options?: never;
92934
93757
  head?: never;
92935
93758
  patch?: never;
92936
93759
  trace?: never;
92937
93760
  };
92938
- "/ads/goal": {
93761
+ "/ads/share/resumen": {
92939
93762
  parameters: {
92940
93763
  query?: never;
92941
93764
  header?: never;
@@ -92943,14 +93766,16 @@ interface paths {
92943
93766
  cookie?: never;
92944
93767
  };
92945
93768
  /**
92946
- * The workspace’s monthly Ads goal
92947
- * @description The goal the Ads hero measures pace against — results from ads, attributed value or return for the calendar month — or `null` when none is set. With `sample=1` answers the sample dataset’s goal.
93769
+ * One calendar month as the Resumen share card (data)
93770
+ * @description The month the monthly Ads email reports, as data: the card’s dominant figure (the return; the outcomes when there is no value yet; the spend when nothing came back), its caption and lines pre-formatted es-CL in the workspace’s nouns, up to three fact-built sentences (no model) and — when the engine’s recent measurement verdict is broken — the reason, printed after «Falta parte del seguimiento:». `period` = `YYYY-MM` (Santiago), default the previous month. No sample mode.
92948
93771
  */
92949
93772
  get: {
92950
93773
  parameters: {
92951
93774
  query?: {
92952
- /** @description `1` serves the deterministic sample dataset («Ver con datos de ejemplo»): same shapes, invented but internally consistent figures, no entitlement required (the scope still is). A sandbox workspace is always served the sample, with or without this parameter. */
92953
- sample?: "1" | "true";
93775
+ /** @description Calendar month `YYYY-MM` (Santiago). Default: the previous month. The running month reads up to today; a month that has not started yet is a 400. */
93776
+ period?: string;
93777
+ /** @description Palette of the image. Default `light`. */
93778
+ theme?: "light" | "dark";
92954
93779
  };
92955
93780
  header?: never;
92956
93781
  path?: never;
@@ -92958,7 +93783,7 @@ interface paths {
92958
93783
  };
92959
93784
  requestBody?: never;
92960
93785
  responses: {
92961
- /** @description The goal, or `null` */
93786
+ /** @description The month card */
92962
93787
  200: {
92963
93788
  headers: {
92964
93789
  [name: string]: unknown;
@@ -92967,16 +93792,46 @@ interface paths {
92967
93792
  /**
92968
93793
  * @example {
92969
93794
  * "data": {
92970
- * "kind": "outcomes",
92971
- * "target": 30,
92972
- * "period": "month",
92973
- * "updated_at": "2026-09-01T12:00:00.000Z",
92974
- * "updated_by": "20000000-0000-4000-8000-000000000001"
93795
+ * "period": {
93796
+ * "month": "2026-08",
93797
+ * "from": "2026-08-01",
93798
+ * "to": "2026-08-31",
93799
+ * "closed": true,
93800
+ * "label": "Agosto · 1 – 31 ago 2026"
93801
+ * },
93802
+ * "vocabulary": "generic",
93803
+ * "has_activity": true,
93804
+ * "dominant": "roas",
93805
+ * "headline": "Agosto: 3,7× de retorno",
93806
+ * "tile": {
93807
+ * "number": "3,7×",
93808
+ * "unit": "retorno",
93809
+ * "caption": "$845.200 invertidos · $3.120.000 en cierres",
93810
+ * "lines": [
93811
+ * "31 cierres desde anuncios",
93812
+ * "Mejor campaña: «Temporada de primavera», 4,2× de retorno",
93813
+ * "En julio: 2,9× de retorno"
93814
+ * ]
93815
+ * },
93816
+ * "sentences": [
93817
+ * "Tus anuncios trajeron **$3.120.000** en cierres, con 31 cierres (el 73,8% del total).",
93818
+ * "La mejor campaña fue «Temporada de primavera», con 4,2× de retorno.",
93819
+ * "Son 7 cierres más que en julio."
93820
+ * ],
93821
+ * "tracking_issue": null,
93822
+ * "image_alt": "3,7× retorno en agosto. $845.200 invertidos · $3.120.000 en cierres. 31 cierres desde anuncios. Mejor campaña: «Temporada de primavera», 4,2× de retorno. En julio: 2,9× de retorno",
93823
+ * "figures": {
93824
+ * "spend": 845200,
93825
+ * "revenue": 3120000,
93826
+ * "roas": 3.69,
93827
+ * "attributed_outcomes": 31,
93828
+ * "best_campaign": "Temporada de primavera"
93829
+ * }
92975
93830
  * }
92976
93831
  * }
92977
93832
  */
92978
93833
  "application/json": {
92979
- data: components["schemas"]["AdsGoal"];
93834
+ data: components["schemas"]["AdsShareResumen"];
92980
93835
  };
92981
93836
  };
92982
93837
  };
@@ -93072,69 +93927,55 @@ interface paths {
93072
93927
  };
93073
93928
  };
93074
93929
  };
93930
+ put?: never;
93931
+ post?: never;
93932
+ delete?: never;
93933
+ options?: never;
93934
+ head?: never;
93935
+ patch?: never;
93936
+ trace?: never;
93937
+ };
93938
+ "/ads/share/resumen.png": {
93939
+ parameters: {
93940
+ query?: never;
93941
+ header?: never;
93942
+ path?: never;
93943
+ cookie?: never;
93944
+ };
93075
93945
  /**
93076
- * Set the monthly Ads goal
93077
- * @description Replaces the goal. `target` > 0; a `roas` goal is at most 100, a `value` goal at most 10^10 CLP, an `outcomes` goal a whole number. The server stamps `updated_at`/`updated_by`. With `sample=1` the goal is validated and echoed with `persisted: false`, never stored.
93946
+ * One calendar month as the Resumen share card (PNG)
93947
+ * @description The same card as `GET /ads/share/resumen`, drawn as the Resumen «Compartir» image: a 1200 × 630 PNG (the monthly Ads email carries its own shorter crop of the same facts instead). Aggregates and the workspace’s own campaign names only. Carries a strong `ETag` (a repeat with `If-None-Match` answers 304) and `Cache-Control: private` — a day for a closed month, five minutes for the running one.
93078
93948
  */
93079
- put: {
93949
+ get: {
93080
93950
  parameters: {
93081
93951
  query?: {
93082
- /** @description `1` serves the deterministic sample dataset («Ver con datos de ejemplo»): same shapes, invented but internally consistent figures, no entitlement required (the scope still is). A sandbox workspace is always served the sample, with or without this parameter. */
93083
- sample?: "1" | "true";
93952
+ /** @description Calendar month `YYYY-MM` (Santiago). Default: the previous month. The running month reads up to today; a month that has not started yet is a 400. */
93953
+ period?: string;
93954
+ /** @description Palette of the image. Default `light`. */
93955
+ theme?: "light" | "dark";
93084
93956
  };
93085
93957
  header?: never;
93086
93958
  path?: never;
93087
93959
  cookie?: never;
93088
93960
  };
93089
- requestBody: {
93090
- content: {
93091
- /**
93092
- * @example {
93093
- * "kind": "outcomes",
93094
- * "target": 30,
93095
- * "period": "month"
93096
- * }
93097
- */
93098
- "application/json": {
93099
- /**
93100
- * @description `outcomes` = results from ads this month; `value` = attributed value (CLP); `roas` = return (×).
93101
- * @enum {string}
93102
- */
93103
- kind: "outcomes" | "value" | "roas";
93104
- /** @description The month’s target. `roas` ≤ 100; `value` ≤ 10^10; `outcomes` ≤ 10^6. */
93105
- target: number;
93106
- /**
93107
- * @description The only period: the calendar month.
93108
- * @enum {string}
93109
- */
93110
- period: "month";
93111
- };
93112
- };
93113
- };
93961
+ requestBody?: never;
93114
93962
  responses: {
93115
- /** @description The stored goal */
93963
+ /** @description The card image */
93116
93964
  200: {
93117
93965
  headers: {
93118
93966
  [name: string]: unknown;
93119
93967
  };
93120
93968
  content: {
93121
- /**
93122
- * @example {
93123
- * "data": {
93124
- * "kind": "outcomes",
93125
- * "target": 30,
93126
- * "period": "month",
93127
- * "updated_at": "2026-09-23T15:00:00.000Z",
93128
- * "updated_by": "20000000-0000-4000-8000-000000000001",
93129
- * "persisted": true
93130
- * }
93131
- * }
93132
- */
93133
- "application/json": {
93134
- data: components["schemas"]["AdsGoal"] & Record<string, never>;
93135
- };
93969
+ "image/png": string;
93136
93970
  };
93137
93971
  };
93972
+ /** @description Unchanged since the `ETag` sent */
93973
+ 304: {
93974
+ headers: {
93975
+ [name: string]: unknown;
93976
+ };
93977
+ content?: never;
93978
+ };
93138
93979
  /** @description Validation error */
93139
93980
  400: {
93140
93981
  headers: {
@@ -93225,124 +94066,30 @@ interface paths {
93225
94066
  "application/json": components["schemas"]["Error"];
93226
94067
  };
93227
94068
  };
93228
- };
93229
- };
93230
- post?: never;
93231
- /**
93232
- * Clear the monthly Ads goal
93233
- * @description Removes the goal. Idempotent. With `sample=1` nothing is stored or removed.
93234
- */
93235
- delete: {
93236
- parameters: {
93237
- query?: {
93238
- /** @description `1` serves the deterministic sample dataset («Ver con datos de ejemplo»): same shapes, invented but internally consistent figures, no entitlement required (the scope still is). A sandbox workspace is always served the sample, with or without this parameter. */
93239
- sample?: "1" | "true";
93240
- };
93241
- header?: never;
93242
- path?: never;
93243
- cookie?: never;
93244
- };
93245
- requestBody?: never;
93246
- responses: {
93247
- /** @description Cleared */
93248
- 204: {
93249
- headers: {
93250
- [name: string]: unknown;
93251
- };
93252
- content?: never;
93253
- };
93254
- /** @description Validation error */
93255
- 400: {
93256
- headers: {
93257
- [name: string]: unknown;
93258
- };
93259
- content: {
93260
- "application/json": components["schemas"]["Error"];
93261
- };
93262
- };
93263
- /** @description Unauthorized */
93264
- 401: {
93265
- headers: {
93266
- [name: string]: unknown;
93267
- };
93268
- content: {
93269
- "application/json": components["schemas"]["Error"];
93270
- };
93271
- };
93272
- /** @description Vitrina Ads is not active for this workspace. `error.code` is `ENTITLEMENT_NOT_ACTIVE`, `error.details.feature` is `vitrina_ads`. */
93273
- 402: {
93274
- headers: {
93275
- [name: string]: unknown;
93276
- };
93277
- content: {
93278
- /**
93279
- * @example {
93280
- * "error": {
93281
- * "code": "ENTITLEMENT_NOT_ACTIVE",
93282
- * "message": "El complemento Vitrina Ads no está activo en este espacio de trabajo.",
93283
- * "details": {
93284
- * "required": [
93285
- * "vitrina_ads"
93286
- * ],
93287
- * "active": [],
93288
- * "feature": "vitrina_ads",
93289
- * "entitlement_state": "off"
93290
- * }
93291
- * }
93292
- * }
93293
- */
93294
- "application/json": components["schemas"]["Error"];
93295
- };
93296
- };
93297
- /** @description Forbidden */
93298
- 403: {
93299
- headers: {
93300
- [name: string]: unknown;
93301
- };
93302
- content: {
93303
- "application/json": components["schemas"]["Error"];
93304
- };
93305
- };
93306
- /** @description Not found */
93307
- 404: {
93308
- headers: {
93309
- [name: string]: unknown;
93310
- };
93311
- content: {
93312
- "application/json": components["schemas"]["Error"];
93313
- };
93314
- };
93315
- /** @description Vitrina Ads is active but the delegated key has not finished rotating (`ADS_KEY_NEEDS_REMINT`) — retry once `GET /ads/state` reports `needs_remint: false`. Also the generic conflict of a write. */
93316
- 409: {
94069
+ /** @description The image rasteriser is not available on this deployment. `error.code` is `SHARE_IMAGE_UNAVAILABLE`; retry after the `Retry-After` seconds. `GET /ads/share/resumen` (the data) is unaffected. */
94070
+ 503: {
93317
94071
  headers: {
94072
+ /** @description Seconds to wait before retrying. */
94073
+ "Retry-After"?: number;
93318
94074
  [name: string]: unknown;
93319
94075
  };
93320
94076
  content: {
93321
94077
  /**
93322
94078
  * @example {
93323
94079
  * "error": {
93324
- * "code": "ADS_KEY_NEEDS_REMINT",
93325
- * "message": "Vitrina Ads is active but the delegated key has not finished rotating (key_kind: core)",
93326
- * "details": {
93327
- * "key_kind": "core"
93328
- * }
94080
+ * "code": "SHARE_IMAGE_UNAVAILABLE",
94081
+ * "message": "La imagen del resumen no está disponible en este momento. Vuelve a intentarlo en unos minutos."
93329
94082
  * }
93330
94083
  * }
93331
94084
  */
93332
94085
  "application/json": components["schemas"]["Error"];
93333
94086
  };
93334
94087
  };
93335
- /** @description Rate limited */
93336
- 429: {
93337
- headers: {
93338
- [name: string]: unknown;
93339
- };
93340
- content: {
93341
- "application/json": components["schemas"]["Error"];
93342
- };
93343
- };
93344
94088
  };
93345
94089
  };
94090
+ put?: never;
94091
+ post?: never;
94092
+ delete?: never;
93346
94093
  options?: never;
93347
94094
  head?: never;
93348
94095
  patch?: never;
@@ -115184,6 +115931,190 @@ interface components {
115184
115931
  author: components["schemas"]["Author"];
115185
115932
  created_at: string;
115186
115933
  };
115934
+ ClinicDiagnostico: {
115935
+ /** @enum {string} */
115936
+ status: "not_started" | "active" | "closed";
115937
+ viewer: {
115938
+ may_start: boolean;
115939
+ };
115940
+ eligibility: {
115941
+ can_start: boolean;
115942
+ /** @enum {string|null} */
115943
+ reason: "no_account" | "not_dentalink" | "money_adopted" | "dpa_required" | "plan_active" | "already_used" | "active" | null;
115944
+ message: string | null;
115945
+ available_on: string | null;
115946
+ };
115947
+ window: {
115948
+ /** Format: uuid */
115949
+ id: string;
115950
+ /** @enum {string} */
115951
+ status: "active" | "closed";
115952
+ /** @enum {string} */
115953
+ phase: "running" | "closing" | "closed";
115954
+ /** @enum {string|null} */
115955
+ closing_reason: "plan_pending" | "finishing" | null;
115956
+ held_until: string | null;
115957
+ started_at: string;
115958
+ ends_at: string;
115959
+ day: number;
115960
+ days_total: number;
115961
+ days_left: number;
115962
+ warned_at: string | null;
115963
+ ended_early_at: string | null;
115964
+ closed_at: string | null;
115965
+ /** @enum {string|null} */
115966
+ outcome: "purged" | "kept_plan" | "kept_preexisting" | null;
115967
+ /** @enum {string} */
115968
+ mirror_origin: "diagnostico" | "preexisting";
115969
+ closing: {
115970
+ deletes_detail: boolean;
115971
+ sentence: string;
115972
+ };
115973
+ runs: {
115974
+ /** @enum {string} */
115975
+ outcome: "purged" | "residual_purged" | "kept_plan" | "kept_preexisting" | "deferred_plan_pending" | "failed";
115976
+ finished_at: string;
115977
+ deleted: {
115978
+ plans: number;
115979
+ plan_lines: number;
115980
+ payments: number;
115981
+ tax_documents: number;
115982
+ };
115983
+ }[];
115984
+ } | null;
115985
+ sync: {
115986
+ /** @enum {string} */
115987
+ state: "copying" | "up_to_date" | "error" | "off";
115988
+ synced_at: string | null;
115989
+ message: string | null;
115990
+ } | null;
115991
+ report: {
115992
+ /** @enum {number} */
115993
+ version: 1;
115994
+ computed_at: string;
115995
+ from: string;
115996
+ to: string;
115997
+ data_through: string | null;
115998
+ /** @enum {string} */
115999
+ state: "ready" | "settling" | "empty";
116000
+ state_reason: string | null;
116001
+ collected: {
116002
+ clp: number | null;
116003
+ previous_clp: number | null;
116004
+ delta_pct: number | null;
116005
+ rule: string;
116006
+ };
116007
+ acceptance: {
116008
+ presented: number | null;
116009
+ accepted: number | null;
116010
+ rate: number | null;
116011
+ presented_clp: number | null;
116012
+ accepted_clp: number | null;
116013
+ /** @enum {string} */
116014
+ formula_status: "acordada" | "propuesta";
116015
+ rule: string;
116016
+ };
116017
+ cierres: {
116018
+ count: number | null;
116019
+ value_clp: number | null;
116020
+ /** @enum {string} */
116021
+ formula_status: "acordada" | "propuesta";
116022
+ rule: string;
116023
+ };
116024
+ by_professional: {
116025
+ professional_id: string;
116026
+ professional_name: string;
116027
+ presented: number | null;
116028
+ accepted: number | null;
116029
+ rate: number | null;
116030
+ accepted_clp: number | null;
116031
+ cierres: number | null;
116032
+ cierres_clp: number | null;
116033
+ suppressed: boolean;
116034
+ }[];
116035
+ months: {
116036
+ month: string;
116037
+ accepted_clp: number | null;
116038
+ produced_clp: number | null;
116039
+ collected_clp: number | null;
116040
+ cierres: number | null;
116041
+ }[];
116042
+ first_visit: {
116043
+ patients: number | null;
116044
+ paid: number | null;
116045
+ rate: number | null;
116046
+ /** @enum {string} */
116047
+ formula_status: "acordada" | "propuesta";
116048
+ rule: string;
116049
+ };
116050
+ second_visit: {
116051
+ eligible: number | null;
116052
+ converted: number | null;
116053
+ rate: number | null;
116054
+ /** @enum {string} */
116055
+ formula_status: "acordada" | "propuesta";
116056
+ rule: string;
116057
+ };
116058
+ botados: {
116059
+ unaccepted: {
116060
+ count: number | null;
116061
+ clp: number | null;
116062
+ suppressed: boolean;
116063
+ };
116064
+ accepted_unscheduled: {
116065
+ count: number | null;
116066
+ clp: number | null;
116067
+ suppressed: boolean;
116068
+ };
116069
+ mid_treatment_no_future_cita: {
116070
+ count: number | null;
116071
+ clp: number | null;
116072
+ suppressed: boolean;
116073
+ };
116074
+ total: {
116075
+ count: number | null;
116076
+ clp: number | null;
116077
+ suppressed: boolean;
116078
+ };
116079
+ focus: string | null;
116080
+ /** @enum {string} */
116081
+ formula_status: "acordada" | "propuesta";
116082
+ rule: string;
116083
+ };
116084
+ band: {
116085
+ band: string;
116086
+ count: number;
116087
+ has_history: boolean;
116088
+ months: {
116089
+ month: string;
116090
+ count: number;
116091
+ }[];
116092
+ uf_month: number | null;
116093
+ estimated_clp_month: number | null;
116094
+ price_label: string | null;
116095
+ rule: string;
116096
+ } | null;
116097
+ } | null;
116098
+ /** @enum {string|null} */
116099
+ report_source: "live" | "stored" | null;
116100
+ plan: {
116101
+ holds_plan: boolean;
116102
+ /** @enum {string} */
116103
+ status: "none" | "awaiting_payment" | "active" | "past_due";
116104
+ };
116105
+ history: {
116106
+ /** Format: uuid */
116107
+ id: string;
116108
+ started_at: string;
116109
+ closed_at: string | null;
116110
+ /** @enum {string|null} */
116111
+ outcome: "purged" | "kept_plan" | "kept_preexisting" | null;
116112
+ label: string;
116113
+ }[];
116114
+ suppression: {
116115
+ min_count: number;
116116
+ } | null;
116117
+ };
115187
116118
  BankFeedSources: {
115188
116119
  email: {
115189
116120
  /** @enum {boolean} */
@@ -115280,24 +116211,27 @@ interface components {
115280
116211
  rule: string;
115281
116212
  };
115282
116213
  acceptance: {
115283
- /** @description Presupuestos presented (issued), one per lineage. */
115284
- presented: number;
115285
- accepted: number;
115286
- /** @description Percent, one decimal. `null` when there was nothing to divide — never 0. */
116214
+ /** @description Presupuestos presented (issued), one per lineage. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116215
+ presented: number | null;
116216
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116217
+ accepted: number | null;
116218
+ /** @description Percent, one decimal. `null` when there was nothing to divide — never 0 — or, for a caller without `clinic_money:read`, when it rests on fewer than 5 cases. */
115287
116219
  rate: number | null;
115288
- /** @description Accepted the day they were issued. */
115289
- same_day: number;
115290
- later: number;
115291
- /** @description Accepted only through a cita still ahead — may drop if it is cancelled. */
115292
- cita_only: number;
115293
- /** @description Not accepted yet, window still open. */
115294
- pending: number;
115295
- /** @description CLP presented, entry lines excluded. */
115296
- presented_clp: number;
115297
- accepted_clp: number;
115298
- /** @description Percent, one decimal. `null` when there was nothing to divide — never 0. */
116220
+ /** @description Accepted the day they were issued. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116221
+ same_day: number | null;
116222
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116223
+ later: number | null;
116224
+ /** @description Accepted only through a cita still ahead — may drop if it is cancelled. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116225
+ cita_only: number | null;
116226
+ /** @description Not accepted yet, window still open. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116227
+ pending: number | null;
116228
+ /** @description CLP presented, entry lines excluded. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116229
+ presented_clp: number | null;
116230
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116231
+ accepted_clp: number | null;
116232
+ /** @description Percent, one decimal. `null` when there was nothing to divide — never 0 — or, for a caller without `clinic_money:read`, when it rests on fewer than 5 cases. */
115299
116233
  rate_30d: number | null;
115300
- /** @description Percent, one decimal. `null` when there was nothing to divide — never 0. */
116234
+ /** @description Percent, one decimal. `null` when there was nothing to divide — never 0 — or, for a caller without `clinic_money:read`, when it rests on fewer than 5 cases. */
115301
116235
  rate_60d: number | null;
115302
116236
  /** @enum {string} */
115303
116237
  formula: "mentores_2026_09_25";
@@ -115306,10 +116240,12 @@ interface components {
115306
116240
  rule: string;
115307
116241
  };
115308
116242
  cierres: {
115309
- count: number;
115310
- /** @description The accepted value of the presupuestos that closed — never the payments. */
115311
- value_clp: number;
115312
- accepted_without_payment: number;
116243
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116244
+ count: number | null;
116245
+ /** @description The accepted value of the presupuestos that closed — never the payments. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116246
+ value_clp: number | null;
116247
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116248
+ accepted_without_payment: number | null;
115313
116249
  /** @enum {string} */
115314
116250
  formula: "cierre_2026_09_25";
115315
116251
  rule: string;
@@ -115317,24 +116253,27 @@ interface components {
115317
116253
  cohorts: {
115318
116254
  /** @description Issue month, `YYYY-MM`. */
115319
116255
  month: string;
115320
- /** @description Presupuestos presented (issued), one per lineage. */
115321
- presented: number;
115322
- accepted: number;
115323
- /** @description Percent, one decimal. `null` when there was nothing to divide — never 0. */
116256
+ /** @description Presupuestos presented (issued), one per lineage. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116257
+ presented: number | null;
116258
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116259
+ accepted: number | null;
116260
+ /** @description Percent, one decimal. `null` when there was nothing to divide — never 0 — or, for a caller without `clinic_money:read`, when it rests on fewer than 5 cases. */
115324
116261
  rate: number | null;
115325
- /** @description Accepted the day they were issued. */
115326
- same_day: number;
115327
- later: number;
115328
- /** @description Accepted only through a cita still ahead — may drop if it is cancelled. */
115329
- cita_only: number;
115330
- /** @description Not accepted yet, window still open. */
115331
- pending: number;
115332
- /** @description CLP presented, entry lines excluded. */
115333
- presented_clp: number;
115334
- accepted_clp: number;
115335
- /** @description Percent, one decimal. `null` when there was nothing to divide — never 0. */
116262
+ /** @description Accepted the day they were issued. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116263
+ same_day: number | null;
116264
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116265
+ later: number | null;
116266
+ /** @description Accepted only through a cita still ahead — may drop if it is cancelled. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116267
+ cita_only: number | null;
116268
+ /** @description Not accepted yet, window still open. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116269
+ pending: number | null;
116270
+ /** @description CLP presented, entry lines excluded. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116271
+ presented_clp: number | null;
116272
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116273
+ accepted_clp: number | null;
116274
+ /** @description Percent, one decimal. `null` when there was nothing to divide — never 0 — or, for a caller without `clinic_money:read`, when it rests on fewer than 5 cases. */
115336
116275
  rate_30d: number | null;
115337
- /** @description Percent, one decimal. `null` when there was nothing to divide — never 0. */
116276
+ /** @description Percent, one decimal. `null` when there was nothing to divide — never 0 — or, for a caller without `clinic_money:read`, when it rests on fewer than 5 cases. */
115338
116277
  rate_60d: number | null;
115339
116278
  /** @description Every presupuesto of the month is past its window. */
115340
116279
  mature: boolean;
@@ -115343,81 +116282,113 @@ interface components {
115343
116282
  /** Format: uuid */
115344
116283
  professional_id: string;
115345
116284
  professional_name: string;
115346
- /** @description Presupuestos presented (issued), one per lineage. */
115347
- presented: number;
115348
- accepted: number;
115349
- /** @description Percent, one decimal. `null` when there was nothing to divide — never 0. */
116285
+ /** @description Presupuestos presented (issued), one per lineage. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116286
+ presented: number | null;
116287
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116288
+ accepted: number | null;
116289
+ /** @description Percent, one decimal. `null` when there was nothing to divide — never 0 — or, for a caller without `clinic_money:read`, when it rests on fewer than 5 cases. */
115350
116290
  rate: number | null;
115351
- /** @description Accepted the day they were issued. */
115352
- same_day: number;
115353
- later: number;
115354
- /** @description Accepted only through a cita still ahead — may drop if it is cancelled. */
115355
- cita_only: number;
115356
- /** @description Not accepted yet, window still open. */
115357
- pending: number;
115358
- /** @description CLP presented, entry lines excluded. */
115359
- presented_clp: number;
115360
- accepted_clp: number;
115361
- cierres: number;
115362
- cierres_clp: number;
116291
+ /** @description Accepted the day they were issued. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116292
+ same_day: number | null;
116293
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116294
+ later: number | null;
116295
+ /** @description Accepted only through a cita still ahead — may drop if it is cancelled. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116296
+ cita_only: number | null;
116297
+ /** @description Not accepted yet, window still open. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116298
+ pending: number | null;
116299
+ /** @description CLP presented, entry lines excluded. `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116300
+ presented_clp: number | null;
116301
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116302
+ accepted_clp: number | null;
116303
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116304
+ cierres: number | null;
116305
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116306
+ cierres_clp: number | null;
115363
116307
  }[];
115364
- unassigned_presented: number;
115365
- unassigned_cierres: number;
116308
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116309
+ unassigned_presented: number | null;
116310
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116311
+ unassigned_cierres: number | null;
115366
116312
  months: {
115367
116313
  month: string;
115368
- accepted_clp: number;
115369
- produced_clp: number;
116314
+ /** @description `null` for a caller without `clinic_money:read`: month rows then carry only the cash. */
116315
+ accepted_clp: number | null;
116316
+ /** @description `null` for a caller without `clinic_money:read`: month rows then carry only the cash. */
116317
+ produced_clp: number | null;
115370
116318
  collected_clp: number | null;
115371
- cierres: number;
115372
- cierres_clp: number;
116319
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116320
+ cierres: number | null;
116321
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116322
+ cierres_clp: number | null;
115373
116323
  }[];
115374
116324
  first_visit: {
115375
116325
  /** @enum {string} */
115376
116326
  formula: "propuesta";
115377
- patients: number;
115378
- paid: number;
115379
- /** @description Percent, one decimal. `null` when there was nothing to divide — never 0. */
116327
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116328
+ patients: number | null;
116329
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116330
+ paid: number | null;
116331
+ /** @description Percent, one decimal. `null` when there was nothing to divide — never 0 — or, for a caller without `clinic_money:read`, when it rests on fewer than 5 cases. */
115380
116332
  rate: number | null;
115381
116333
  rule: string;
115382
116334
  };
115383
116335
  second_visit: {
115384
116336
  /** @enum {string} */
115385
116337
  formula: "propuesta";
115386
- eligible: number;
115387
- converted: number;
115388
- /** @description Percent, one decimal. `null` when there was nothing to divide — never 0. */
116338
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116339
+ eligible: number | null;
116340
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116341
+ converted: number | null;
116342
+ /** @description Percent, one decimal. `null` when there was nothing to divide — never 0 — or, for a caller without `clinic_money:read`, when it rests on fewer than 5 cases. */
115389
116343
  rate: number | null;
115390
116344
  rule: string;
115391
116345
  };
115392
116346
  botados: {
115393
116347
  unaccepted: {
115394
- count: number;
115395
- clp: number;
116348
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116349
+ count: number | null;
116350
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116351
+ clp: number | null;
115396
116352
  };
115397
116353
  accepted_unscheduled: {
115398
- count: number;
115399
- clp: number;
116354
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116355
+ count: number | null;
116356
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116357
+ clp: number | null;
115400
116358
  };
115401
116359
  mid_treatment_no_future_cita: {
115402
- count: number;
115403
- clp: number;
116360
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116361
+ count: number | null;
116362
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116363
+ clp: number | null;
115404
116364
  };
115405
116365
  /** @enum {string} */
115406
116366
  formula: "propuesta";
115407
116367
  /** @enum {string} */
115408
116368
  basis: "live_last_6_months";
115409
116369
  total: {
115410
- count: number;
115411
- clp: number;
116370
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116371
+ count: number | null;
116372
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116373
+ clp: number | null;
115412
116374
  };
115413
116375
  /** @enum {string|null} */
115414
116376
  focus: "unaccepted" | "accepted_unscheduled" | "mid_treatment_no_future_cita" | null;
115415
116377
  rule: string;
115416
116378
  };
115417
116379
  coverage: {
115418
- plans_without_lines: number;
115419
- excluded_zero: number;
115420
- excluded_entry_only: number;
116380
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116381
+ plans_without_lines: number | null;
116382
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116383
+ excluded_zero: number | null;
116384
+ /** @description `null` only for a caller without `clinic_money:read`, when it rests on 1–4 cases. */
116385
+ excluded_entry_only: number | null;
116386
+ };
116387
+ suppression?: {
116388
+ min_count: number;
116389
+ professionals_withheld: number;
116390
+ /** @description The Consultor view always reads the last 3 closed calendar months (the report's `from`/`to`) and ignores the requested range and professional / sucursal filters. */
116391
+ filters_ignored?: boolean;
115421
116392
  };
115422
116393
  };
115423
116394
  AdsState: {
@@ -115726,6 +116697,36 @@ interface components {
115726
116697
  test_events_link: string | null;
115727
116698
  simulated: boolean;
115728
116699
  };
116700
+ AdOrigin: {
116701
+ /**
116702
+ * @description Where the thread lives — the conversation channel.
116703
+ * @enum {string}
116704
+ */
116705
+ platform: "whatsapp" | "instagram" | "messenger";
116706
+ /**
116707
+ * @description `post` when the person tapped a boosted post, else `ad`.
116708
+ * @enum {string}
116709
+ */
116710
+ kind: "ad" | "post";
116711
+ /** @description Meta's ad id; `null` for a post or when Meta sent none. */
116712
+ ad_external_id: string | null;
116713
+ /** @description The ad name in the ad account; `null` when unknown. */
116714
+ ad_name: string | null;
116715
+ /** @description The ad's campaign name; `null` when unknown. */
116716
+ campaign_name: string | null;
116717
+ /** @description The ad's headline — the ADVERTISER'S copy, never the customer's words. */
116718
+ title: string | null;
116719
+ /** @description Still image of the creative: our durable copy when `media_archived`, else Meta’s own link. */
116720
+ thumbnail_url: string | null;
116721
+ /** @description `true` when `thumbnail_url` is Vitrina’s durable copy; `false` when it is a Meta CDN link that expires (render with a fallback) or absent. */
116722
+ media_archived: boolean;
116723
+ /** @description The creative’s video when a video ad (a Meta CDN link — it expires). */
116724
+ video_url: string | null;
116725
+ /** @description Permalink to the ad or the post it promotes, when known. */
116726
+ source_url: string | null;
116727
+ /** @description When the thread opened from the ad (the conversation creation time). */
116728
+ captured_at: string | null;
116729
+ } | null;
115729
116730
  Message: {
115730
116731
  id: string;
115731
116732
  conversation_id: string;
@@ -116190,6 +117191,54 @@ interface components {
116190
117191
  /** @description `false` in sample mode: the goal was validated but not stored. */
116191
117192
  persisted?: boolean;
116192
117193
  } | null;
117194
+ AdsShareResumen: {
117195
+ period: {
117196
+ /** @description `YYYY-MM`. */
117197
+ month: string;
117198
+ from: string;
117199
+ to: string;
117200
+ /** @description `false` for the running month (figures still growing). */
117201
+ closed: boolean;
117202
+ /** @description The period line printed on the card, «Agosto · 1 – 31 ago 2026». */
117203
+ label: string;
117204
+ };
117205
+ /**
117206
+ * @description The noun family every label and sentence was written in.
117207
+ * @enum {string}
117208
+ */
117209
+ vocabulary: "automotive" | "healthcare" | "generic";
117210
+ /** @description `true` when the month had spend or ad-attributed outcomes. `false` = nothing to report (the monthly email is not sent for such a month). */
117211
+ has_activity: boolean;
117212
+ /**
117213
+ * @description The figure the card leads with: the return when the month has value, else the outcomes, else the spend. `null` without activity.
117214
+ * @enum {string|null}
117215
+ */
117216
+ dominant: "roas" | "outcomes" | "spend" | null;
117217
+ /** @description The dominant figure as a title, month first («Agosto: 3,7× de retorno»). */
117218
+ headline: string;
117219
+ /** @description The card as drawn, pre-formatted es-CL, in the tenant’s nouns. */
117220
+ tile: {
117221
+ /** @description Display number («3,7×»). */
117222
+ number: string;
117223
+ /** @description Its unit («retorno»). */
117224
+ unit: string | null;
117225
+ caption: string;
117226
+ lines: string[];
117227
+ };
117228
+ /** @description Up to three fact-built sentences (no model) — the value, count, best campaign and change the image does not carry. `**x**` marks the lead figure. */
117229
+ sentences: string[];
117230
+ /** @description Set when the engine’s measurement verdict for the trailing 30 days (on the 1st–3rd, roughly the month just closed) is broken — the reason in plain words («el tag de tu sitio no envió datos»), printed after «Falta parte del seguimiento:». Never from today’s Meta or tag state. `null` when measurement was sound or could not be read. */
117231
+ tracking_issue: string | null;
117232
+ /** @description Alt text for the card image. */
117233
+ image_alt: string;
117234
+ figures: {
117235
+ spend: number | null;
117236
+ revenue: number | null;
117237
+ roas: number | null;
117238
+ attributed_outcomes: number | null;
117239
+ best_campaign: string | null;
117240
+ };
117241
+ };
116193
117242
  AdsAction: {
116194
117243
  /** @description `<kind>:<target external id>:<YYYY-MM-DD>` — a composite key, stable for a day. */
116195
117244
  key: string;
@@ -116476,7 +117525,7 @@ declare function createClient(opts: CreateClientOptions): VitrinaClient;
116476
117525
  * is regenerated — narrow on the ones you handle, never assume this
116477
117526
  * list is exhaustive at runtime.
116478
117527
  */
116479
- type ErrorCode = 'VALIDATION_ERROR' | 'NOT_FOUND' | 'UNAUTHORIZED' | 'FORBIDDEN' | 'CONFLICT' | 'UNIQUE_CONFLICT' | 'IDEMPOTENCY_KEY_CONFLICT' | 'VERTICAL_NOT_ENABLED' | 'ENTITLEMENT_NOT_ACTIVE' | 'UNSUPPORTED_VEHICLE_TYPE' | 'NO_OFFERING_ADAPTER' | 'PAYLOAD_TOO_LARGE' | 'UNSUPPORTED_MEDIA_TYPE' | 'UPSTREAM_ERROR' | 'RATE_LIMITED' | 'GONE' | 'INTERNAL_ERROR' | 'MESSAGING_ACCOUNT_TENANT_MISSING' | 'COPILOT_APPROVALS_UNAVAILABLE' | 'COPILOT_APPROVAL_REPLAY_BLOCKED' | 'COPILOT_DISABLED' | 'COPILOT_BUDGET_EXCEEDED' | 'DEALER_SITES_NOT_CONFIGURED' | 'STOREFRONT_ZONES_NOT_CONFIGURED' | 'RECONTACTO_NOT_ENABLED' | 'SYNC_QUEUE_UNAVAILABLE' | 'ATTRIBUTION_PROFILE_UNAVAILABLE' | 'ATTRIBUTION_PROFILE_MISMATCH' | 'ADS_KEY_NEEDS_REMINT' | 'ADS_ACTION_REPLAY_BLOCKED' | 'ADS_ACTION_NOT_AVAILABLE' | 'ADS_ACTION_NOT_REVERSIBLE' | 'ADS_ACTION_CONSENT_REQUIRED' | 'MISSING_SIGNATURE' | 'MALFORMED_SIGNATURE' | 'STALE_SIGNATURE' | 'INVALID_SIGNATURE' | 'REPLAY_DETECTED' | 'TURNSTILE_UNAVAILABLE' | 'TASADOR_QUOTA_EXHAUSTED' | 'TASADOR_ANON_DAILY_LIMIT' | 'TASADOR_CAPACITY_REACHED' | 'CLINIC_PLAN_REQUIRED' | 'TENANT_BILLING_PAUSED' | 'FACEBOOK_MARKETPLACE_NOT_AVAILABLE' | 'WORKSPACE_MEMBER_INACTIVE' | 'DEVICE_AGENT_ALREADY_PAIRED' | 'DEVICE_AGENT_SELF_REQUIRES_USER' | 'DEVICE_AGENT_KIND_NOT_ALLOWED' | 'DEVICE_TASK_STATUS_NOT_ALLOWED' | 'FACEBOOK_MARKETPLACE_NO_PHONE_AGENT' | 'FACEBOOK_MARKETPLACE_THREAD_NOT_ADDRESSABLE' | 'FACEBOOK_MARKETPLACE_ATTACHMENT_UNSUPPORTED' | 'REPLY_PACING_LOCKED' | 'SANDBOX_CHANNEL_FORBIDDEN' | 'SANDBOX_BILLING_FORBIDDEN' | 'SANDBOX_NOT_PROVISIONED' | 'SANDBOX_RESET_UNAVAILABLE' | 'CONNECTED_APP_SENSITIVE_DATA' | 'handoff_mismatch' | 'sync_in_flight' | 'atribu_refused' | 'start_again' | 'reconnect' | 'partner_token_invalid' | 'OUTBOUND_BLOCKED' | 'OUTBOUND_WARNING' | 'dpa_acceptance_required' | 'EMAIL_SENDER_UNRESOLVED' | 'CAMPAIGN_FROM_CONNECTED_MAILBOX' | 'BANK_FEED_NOT_CONFIGURED' | 'ADDON_NOT_PRICED' | 'MIRROR_LINES_UNMAPPED';
117528
+ type ErrorCode = 'VALIDATION_ERROR' | 'NOT_FOUND' | 'UNAUTHORIZED' | 'FORBIDDEN' | 'CONFLICT' | 'UNIQUE_CONFLICT' | 'IDEMPOTENCY_KEY_CONFLICT' | 'VERTICAL_NOT_ENABLED' | 'ENTITLEMENT_NOT_ACTIVE' | 'UNSUPPORTED_VEHICLE_TYPE' | 'NO_OFFERING_ADAPTER' | 'PAYLOAD_TOO_LARGE' | 'UNSUPPORTED_MEDIA_TYPE' | 'UPSTREAM_ERROR' | 'RATE_LIMITED' | 'GONE' | 'INTERNAL_ERROR' | 'MESSAGING_ACCOUNT_TENANT_MISSING' | 'COPILOT_APPROVALS_UNAVAILABLE' | 'COPILOT_APPROVAL_REPLAY_BLOCKED' | 'COPILOT_DISABLED' | 'COPILOT_BUDGET_EXCEEDED' | 'DEALER_SITES_NOT_CONFIGURED' | 'STOREFRONT_ZONES_NOT_CONFIGURED' | 'RECONTACTO_NOT_ENABLED' | 'SYNC_QUEUE_UNAVAILABLE' | 'SHARE_IMAGE_UNAVAILABLE' | 'ATTRIBUTION_PROFILE_UNAVAILABLE' | 'ATTRIBUTION_PROFILE_MISMATCH' | 'ADS_KEY_NEEDS_REMINT' | 'ADS_ACTION_REPLAY_BLOCKED' | 'ADS_ACTION_NOT_AVAILABLE' | 'ADS_ACTION_NOT_REVERSIBLE' | 'ADS_ACTION_CONSENT_REQUIRED' | 'MISSING_SIGNATURE' | 'MALFORMED_SIGNATURE' | 'STALE_SIGNATURE' | 'INVALID_SIGNATURE' | 'REPLAY_DETECTED' | 'TURNSTILE_UNAVAILABLE' | 'TASADOR_QUOTA_EXHAUSTED' | 'TASADOR_ANON_DAILY_LIMIT' | 'TASADOR_CAPACITY_REACHED' | 'CLINIC_PLAN_REQUIRED' | 'TENANT_BILLING_PAUSED' | 'FACEBOOK_MARKETPLACE_NOT_AVAILABLE' | 'WORKSPACE_MEMBER_INACTIVE' | 'DEVICE_AGENT_ALREADY_PAIRED' | 'DEVICE_AGENT_SELF_REQUIRES_USER' | 'DEVICE_AGENT_KIND_NOT_ALLOWED' | 'DEVICE_TASK_STATUS_NOT_ALLOWED' | 'FACEBOOK_MARKETPLACE_NO_PHONE_AGENT' | 'FACEBOOK_MARKETPLACE_THREAD_NOT_ADDRESSABLE' | 'FACEBOOK_MARKETPLACE_ATTACHMENT_UNSUPPORTED' | 'REPLY_PACING_LOCKED' | 'SANDBOX_CHANNEL_FORBIDDEN' | 'SANDBOX_BILLING_FORBIDDEN' | 'SANDBOX_NOT_PROVISIONED' | 'SANDBOX_RESET_UNAVAILABLE' | 'CONNECTED_APP_SENSITIVE_DATA' | 'handoff_mismatch' | 'sync_in_flight' | 'atribu_refused' | 'start_again' | 'reconnect' | 'partner_token_invalid' | 'OUTBOUND_BLOCKED' | 'OUTBOUND_WARNING' | 'dpa_acceptance_required' | 'EMAIL_SENDER_UNRESOLVED' | 'CAMPAIGN_FROM_CONNECTED_MAILBOX' | 'BANK_FEED_NOT_CONFIGURED' | 'ADDON_NOT_PRICED' | 'MIRROR_LINES_UNMAPPED';
116480
117529
  declare const ERROR_CODES: readonly ErrorCode[];
116481
117530
 
116482
117531
  /**