@vitrina/api 11.15.0 → 11.16.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
@@ -13154,6 +13154,302 @@ interface paths {
13154
13154
  patch?: never;
13155
13155
  trace?: never;
13156
13156
  };
13157
+ "/messaging-accounts/{id}/ai-availability": {
13158
+ parameters: {
13159
+ query?: never;
13160
+ header?: never;
13161
+ path?: never;
13162
+ cookie?: never;
13163
+ };
13164
+ /**
13165
+ * Read the channel AI availability policy and current status
13166
+ * @description Returns the per-channel coverage clock and its current evaluation. Schedule availability does not override agent assignment, channel kill switches, or a human takeover. An account without a saved policy reports `configured: false` and preserves the legacy always-eligible schedule. `policy.timezone` and `status.effective_timezone` report the server-resolved clock inherited from General settings or selected business hours. `policy.human_silence_resume` and `policy.handoff_renotify` are always present in the response with defaults applied (enabled, 30 minutes).
13167
+ */
13168
+ get: {
13169
+ parameters: {
13170
+ query?: never;
13171
+ header?: never;
13172
+ path: {
13173
+ id: string;
13174
+ };
13175
+ cookie?: never;
13176
+ };
13177
+ requestBody?: never;
13178
+ responses: {
13179
+ /** @description AI availability policy and status */
13180
+ 200: {
13181
+ headers: {
13182
+ [name: string]: unknown;
13183
+ };
13184
+ content: {
13185
+ /**
13186
+ * @example {
13187
+ * "data": {
13188
+ * "policy": {
13189
+ * "mode": "outside_business_hours",
13190
+ * "resume_human_conversations": false,
13191
+ * "business_hours_source": "workspace",
13192
+ * "team_id": null,
13193
+ * "weekly_windows": [],
13194
+ * "human_silence_resume": {
13195
+ * "enabled": true,
13196
+ * "minutes": 30
13197
+ * },
13198
+ * "handoff_renotify": {
13199
+ * "enabled": true,
13200
+ * "minutes": 30
13201
+ * },
13202
+ * "timezone": "America/Santiago"
13203
+ * },
13204
+ * "status": {
13205
+ * "configured": true,
13206
+ * "available": false,
13207
+ * "reason": "inside_business_hours",
13208
+ * "window_start": "2026-09-15T12:00:00.000Z",
13209
+ * "window_end": "2026-09-15T22:00:00.000Z",
13210
+ * "next_transition": "2026-09-15T22:00:00.000Z",
13211
+ * "effective_timezone": "America/Santiago",
13212
+ * "policy_revision": "sha256:<revision>"
13213
+ * }
13214
+ * }
13215
+ * }
13216
+ */
13217
+ "application/json": {
13218
+ data?: unknown;
13219
+ meta?: {
13220
+ [key: string]: unknown;
13221
+ };
13222
+ };
13223
+ };
13224
+ };
13225
+ /** @description Validation error */
13226
+ 400: {
13227
+ headers: {
13228
+ [name: string]: unknown;
13229
+ };
13230
+ content: {
13231
+ "application/json": components["schemas"]["Error"];
13232
+ };
13233
+ };
13234
+ /** @description Unauthorized */
13235
+ 401: {
13236
+ headers: {
13237
+ [name: string]: unknown;
13238
+ };
13239
+ content: {
13240
+ "application/json": components["schemas"]["Error"];
13241
+ };
13242
+ };
13243
+ /** @description Forbidden */
13244
+ 403: {
13245
+ headers: {
13246
+ [name: string]: unknown;
13247
+ };
13248
+ content: {
13249
+ "application/json": components["schemas"]["Error"];
13250
+ };
13251
+ };
13252
+ /** @description Not found */
13253
+ 404: {
13254
+ headers: {
13255
+ [name: string]: unknown;
13256
+ };
13257
+ content: {
13258
+ "application/json": components["schemas"]["Error"];
13259
+ };
13260
+ };
13261
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
13262
+ 409: {
13263
+ headers: {
13264
+ [name: string]: unknown;
13265
+ };
13266
+ content: {
13267
+ "application/json": components["schemas"]["Error"];
13268
+ };
13269
+ };
13270
+ /** @description Rate limited */
13271
+ 429: {
13272
+ headers: {
13273
+ [name: string]: unknown;
13274
+ };
13275
+ content: {
13276
+ "application/json": components["schemas"]["Error"];
13277
+ };
13278
+ };
13279
+ };
13280
+ };
13281
+ put?: never;
13282
+ post?: never;
13283
+ delete?: never;
13284
+ options?: never;
13285
+ head?: never;
13286
+ /**
13287
+ * Set the channel AI availability policy
13288
+ * @description Persists an always, outside-business-hours, or custom weekly schedule. Custom windows may cross midnight; overlapping windows are rejected. Custom schedules inherit General timezone, then workspace business-hours timezone, then America/Santiago. The optional legacy timezone field is accepted for compatibility and normalized by the server. Outside-business-hours mode requires configured workspace or tenant-owned team hours. The follow-through rules are optional: `human_silence_resume` (the AI takes back a conversation a person took over when a customer message gets no team reply in N minutes) and `handoff_renotify` (after an AI handoff, re-notify the team every N minutes while the customer waits). Omitting either keeps the value already saved on the channel.
13289
+ */
13290
+ patch: {
13291
+ parameters: {
13292
+ query?: never;
13293
+ header?: never;
13294
+ path: {
13295
+ id: string;
13296
+ };
13297
+ cookie?: never;
13298
+ };
13299
+ requestBody?: {
13300
+ content: {
13301
+ /**
13302
+ * @example {
13303
+ * "mode": "outside_business_hours",
13304
+ * "resume_human_conversations": false,
13305
+ * "business_hours_source": "workspace",
13306
+ * "team_id": null,
13307
+ * "weekly_windows": [],
13308
+ * "human_silence_resume": {
13309
+ * "enabled": true,
13310
+ * "minutes": 30
13311
+ * },
13312
+ * "handoff_renotify": {
13313
+ * "enabled": true,
13314
+ * "minutes": 30
13315
+ * }
13316
+ * }
13317
+ */
13318
+ "application/json": {
13319
+ /** @enum {string} */
13320
+ mode: "always" | "outside_business_hours" | "custom";
13321
+ /** @description While the channel is available, let the AI answer inbound customer messages on conversations a human is handling. Only ever a reply to an incoming message: nothing is sent at window start and the inbox is never swept for unanswered threads (ADR 0102 §5). */
13322
+ resume_human_conversations: boolean;
13323
+ /** @enum {string} */
13324
+ business_hours_source: "workspace" | "team";
13325
+ /** Format: uuid */
13326
+ team_id: string | null;
13327
+ /** @default America/Santiago */
13328
+ timezone?: string;
13329
+ weekly_windows: {
13330
+ /** @enum {string} */
13331
+ day: "mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun";
13332
+ start: string;
13333
+ end: string;
13334
+ }[];
13335
+ /** @description A person took the conversation without an AI handoff (a reply from the WhatsApp Business or Instagram app, or from the inbox). When a customer message then gets no team reply within `minutes`, the AI answers it and the conversation returns to the AI. Only ever triggered by an incoming message; nothing is swept. Absent = enabled, 30 minutes. */
13336
+ human_silence_resume?: {
13337
+ enabled: boolean;
13338
+ minutes: number;
13339
+ };
13340
+ /** @description The AI handed the conversation off explicitly, so it stays out. While the customer's message stays unanswered, notify the assignee (or, when nobody is assigned, the channel roster) every `minutes`, with owners and admins copied. Checked on a 10-minute tick; stops 24 hours after the customer's message. Absent = enabled, 30 minutes. */
13341
+ handoff_renotify?: {
13342
+ enabled: boolean;
13343
+ minutes: number;
13344
+ };
13345
+ };
13346
+ };
13347
+ };
13348
+ responses: {
13349
+ /** @description AI availability policy and status */
13350
+ 200: {
13351
+ headers: {
13352
+ [name: string]: unknown;
13353
+ };
13354
+ content: {
13355
+ /**
13356
+ * @example {
13357
+ * "data": {
13358
+ * "policy": {
13359
+ * "mode": "outside_business_hours",
13360
+ * "resume_human_conversations": false,
13361
+ * "business_hours_source": "workspace",
13362
+ * "team_id": null,
13363
+ * "weekly_windows": [],
13364
+ * "human_silence_resume": {
13365
+ * "enabled": true,
13366
+ * "minutes": 30
13367
+ * },
13368
+ * "handoff_renotify": {
13369
+ * "enabled": true,
13370
+ * "minutes": 30
13371
+ * },
13372
+ * "timezone": "America/Santiago"
13373
+ * },
13374
+ * "status": {
13375
+ * "configured": true,
13376
+ * "available": false,
13377
+ * "reason": "inside_business_hours",
13378
+ * "window_start": "2026-09-15T12:00:00.000Z",
13379
+ * "window_end": "2026-09-15T22:00:00.000Z",
13380
+ * "next_transition": "2026-09-15T22:00:00.000Z",
13381
+ * "effective_timezone": "America/Santiago",
13382
+ * "policy_revision": "sha256:<revision>"
13383
+ * }
13384
+ * }
13385
+ * }
13386
+ */
13387
+ "application/json": {
13388
+ data?: unknown;
13389
+ meta?: {
13390
+ [key: string]: unknown;
13391
+ };
13392
+ };
13393
+ };
13394
+ };
13395
+ /** @description Validation error */
13396
+ 400: {
13397
+ headers: {
13398
+ [name: string]: unknown;
13399
+ };
13400
+ content: {
13401
+ "application/json": components["schemas"]["Error"];
13402
+ };
13403
+ };
13404
+ /** @description Unauthorized */
13405
+ 401: {
13406
+ headers: {
13407
+ [name: string]: unknown;
13408
+ };
13409
+ content: {
13410
+ "application/json": components["schemas"]["Error"];
13411
+ };
13412
+ };
13413
+ /** @description Forbidden */
13414
+ 403: {
13415
+ headers: {
13416
+ [name: string]: unknown;
13417
+ };
13418
+ content: {
13419
+ "application/json": components["schemas"]["Error"];
13420
+ };
13421
+ };
13422
+ /** @description Not found */
13423
+ 404: {
13424
+ headers: {
13425
+ [name: string]: unknown;
13426
+ };
13427
+ content: {
13428
+ "application/json": components["schemas"]["Error"];
13429
+ };
13430
+ };
13431
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
13432
+ 409: {
13433
+ headers: {
13434
+ [name: string]: unknown;
13435
+ };
13436
+ content: {
13437
+ "application/json": components["schemas"]["Error"];
13438
+ };
13439
+ };
13440
+ /** @description Rate limited */
13441
+ 429: {
13442
+ headers: {
13443
+ [name: string]: unknown;
13444
+ };
13445
+ content: {
13446
+ "application/json": components["schemas"]["Error"];
13447
+ };
13448
+ };
13449
+ };
13450
+ };
13451
+ trace?: never;
13452
+ };
13157
13453
  "/tenant/settings": {
13158
13454
  parameters: {
13159
13455
  query?: never;
package/dist/index.d.ts CHANGED
@@ -13154,6 +13154,302 @@ interface paths {
13154
13154
  patch?: never;
13155
13155
  trace?: never;
13156
13156
  };
13157
+ "/messaging-accounts/{id}/ai-availability": {
13158
+ parameters: {
13159
+ query?: never;
13160
+ header?: never;
13161
+ path?: never;
13162
+ cookie?: never;
13163
+ };
13164
+ /**
13165
+ * Read the channel AI availability policy and current status
13166
+ * @description Returns the per-channel coverage clock and its current evaluation. Schedule availability does not override agent assignment, channel kill switches, or a human takeover. An account without a saved policy reports `configured: false` and preserves the legacy always-eligible schedule. `policy.timezone` and `status.effective_timezone` report the server-resolved clock inherited from General settings or selected business hours. `policy.human_silence_resume` and `policy.handoff_renotify` are always present in the response with defaults applied (enabled, 30 minutes).
13167
+ */
13168
+ get: {
13169
+ parameters: {
13170
+ query?: never;
13171
+ header?: never;
13172
+ path: {
13173
+ id: string;
13174
+ };
13175
+ cookie?: never;
13176
+ };
13177
+ requestBody?: never;
13178
+ responses: {
13179
+ /** @description AI availability policy and status */
13180
+ 200: {
13181
+ headers: {
13182
+ [name: string]: unknown;
13183
+ };
13184
+ content: {
13185
+ /**
13186
+ * @example {
13187
+ * "data": {
13188
+ * "policy": {
13189
+ * "mode": "outside_business_hours",
13190
+ * "resume_human_conversations": false,
13191
+ * "business_hours_source": "workspace",
13192
+ * "team_id": null,
13193
+ * "weekly_windows": [],
13194
+ * "human_silence_resume": {
13195
+ * "enabled": true,
13196
+ * "minutes": 30
13197
+ * },
13198
+ * "handoff_renotify": {
13199
+ * "enabled": true,
13200
+ * "minutes": 30
13201
+ * },
13202
+ * "timezone": "America/Santiago"
13203
+ * },
13204
+ * "status": {
13205
+ * "configured": true,
13206
+ * "available": false,
13207
+ * "reason": "inside_business_hours",
13208
+ * "window_start": "2026-09-15T12:00:00.000Z",
13209
+ * "window_end": "2026-09-15T22:00:00.000Z",
13210
+ * "next_transition": "2026-09-15T22:00:00.000Z",
13211
+ * "effective_timezone": "America/Santiago",
13212
+ * "policy_revision": "sha256:<revision>"
13213
+ * }
13214
+ * }
13215
+ * }
13216
+ */
13217
+ "application/json": {
13218
+ data?: unknown;
13219
+ meta?: {
13220
+ [key: string]: unknown;
13221
+ };
13222
+ };
13223
+ };
13224
+ };
13225
+ /** @description Validation error */
13226
+ 400: {
13227
+ headers: {
13228
+ [name: string]: unknown;
13229
+ };
13230
+ content: {
13231
+ "application/json": components["schemas"]["Error"];
13232
+ };
13233
+ };
13234
+ /** @description Unauthorized */
13235
+ 401: {
13236
+ headers: {
13237
+ [name: string]: unknown;
13238
+ };
13239
+ content: {
13240
+ "application/json": components["schemas"]["Error"];
13241
+ };
13242
+ };
13243
+ /** @description Forbidden */
13244
+ 403: {
13245
+ headers: {
13246
+ [name: string]: unknown;
13247
+ };
13248
+ content: {
13249
+ "application/json": components["schemas"]["Error"];
13250
+ };
13251
+ };
13252
+ /** @description Not found */
13253
+ 404: {
13254
+ headers: {
13255
+ [name: string]: unknown;
13256
+ };
13257
+ content: {
13258
+ "application/json": components["schemas"]["Error"];
13259
+ };
13260
+ };
13261
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
13262
+ 409: {
13263
+ headers: {
13264
+ [name: string]: unknown;
13265
+ };
13266
+ content: {
13267
+ "application/json": components["schemas"]["Error"];
13268
+ };
13269
+ };
13270
+ /** @description Rate limited */
13271
+ 429: {
13272
+ headers: {
13273
+ [name: string]: unknown;
13274
+ };
13275
+ content: {
13276
+ "application/json": components["schemas"]["Error"];
13277
+ };
13278
+ };
13279
+ };
13280
+ };
13281
+ put?: never;
13282
+ post?: never;
13283
+ delete?: never;
13284
+ options?: never;
13285
+ head?: never;
13286
+ /**
13287
+ * Set the channel AI availability policy
13288
+ * @description Persists an always, outside-business-hours, or custom weekly schedule. Custom windows may cross midnight; overlapping windows are rejected. Custom schedules inherit General timezone, then workspace business-hours timezone, then America/Santiago. The optional legacy timezone field is accepted for compatibility and normalized by the server. Outside-business-hours mode requires configured workspace or tenant-owned team hours. The follow-through rules are optional: `human_silence_resume` (the AI takes back a conversation a person took over when a customer message gets no team reply in N minutes) and `handoff_renotify` (after an AI handoff, re-notify the team every N minutes while the customer waits). Omitting either keeps the value already saved on the channel.
13289
+ */
13290
+ patch: {
13291
+ parameters: {
13292
+ query?: never;
13293
+ header?: never;
13294
+ path: {
13295
+ id: string;
13296
+ };
13297
+ cookie?: never;
13298
+ };
13299
+ requestBody?: {
13300
+ content: {
13301
+ /**
13302
+ * @example {
13303
+ * "mode": "outside_business_hours",
13304
+ * "resume_human_conversations": false,
13305
+ * "business_hours_source": "workspace",
13306
+ * "team_id": null,
13307
+ * "weekly_windows": [],
13308
+ * "human_silence_resume": {
13309
+ * "enabled": true,
13310
+ * "minutes": 30
13311
+ * },
13312
+ * "handoff_renotify": {
13313
+ * "enabled": true,
13314
+ * "minutes": 30
13315
+ * }
13316
+ * }
13317
+ */
13318
+ "application/json": {
13319
+ /** @enum {string} */
13320
+ mode: "always" | "outside_business_hours" | "custom";
13321
+ /** @description While the channel is available, let the AI answer inbound customer messages on conversations a human is handling. Only ever a reply to an incoming message: nothing is sent at window start and the inbox is never swept for unanswered threads (ADR 0102 §5). */
13322
+ resume_human_conversations: boolean;
13323
+ /** @enum {string} */
13324
+ business_hours_source: "workspace" | "team";
13325
+ /** Format: uuid */
13326
+ team_id: string | null;
13327
+ /** @default America/Santiago */
13328
+ timezone?: string;
13329
+ weekly_windows: {
13330
+ /** @enum {string} */
13331
+ day: "mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun";
13332
+ start: string;
13333
+ end: string;
13334
+ }[];
13335
+ /** @description A person took the conversation without an AI handoff (a reply from the WhatsApp Business or Instagram app, or from the inbox). When a customer message then gets no team reply within `minutes`, the AI answers it and the conversation returns to the AI. Only ever triggered by an incoming message; nothing is swept. Absent = enabled, 30 minutes. */
13336
+ human_silence_resume?: {
13337
+ enabled: boolean;
13338
+ minutes: number;
13339
+ };
13340
+ /** @description The AI handed the conversation off explicitly, so it stays out. While the customer's message stays unanswered, notify the assignee (or, when nobody is assigned, the channel roster) every `minutes`, with owners and admins copied. Checked on a 10-minute tick; stops 24 hours after the customer's message. Absent = enabled, 30 minutes. */
13341
+ handoff_renotify?: {
13342
+ enabled: boolean;
13343
+ minutes: number;
13344
+ };
13345
+ };
13346
+ };
13347
+ };
13348
+ responses: {
13349
+ /** @description AI availability policy and status */
13350
+ 200: {
13351
+ headers: {
13352
+ [name: string]: unknown;
13353
+ };
13354
+ content: {
13355
+ /**
13356
+ * @example {
13357
+ * "data": {
13358
+ * "policy": {
13359
+ * "mode": "outside_business_hours",
13360
+ * "resume_human_conversations": false,
13361
+ * "business_hours_source": "workspace",
13362
+ * "team_id": null,
13363
+ * "weekly_windows": [],
13364
+ * "human_silence_resume": {
13365
+ * "enabled": true,
13366
+ * "minutes": 30
13367
+ * },
13368
+ * "handoff_renotify": {
13369
+ * "enabled": true,
13370
+ * "minutes": 30
13371
+ * },
13372
+ * "timezone": "America/Santiago"
13373
+ * },
13374
+ * "status": {
13375
+ * "configured": true,
13376
+ * "available": false,
13377
+ * "reason": "inside_business_hours",
13378
+ * "window_start": "2026-09-15T12:00:00.000Z",
13379
+ * "window_end": "2026-09-15T22:00:00.000Z",
13380
+ * "next_transition": "2026-09-15T22:00:00.000Z",
13381
+ * "effective_timezone": "America/Santiago",
13382
+ * "policy_revision": "sha256:<revision>"
13383
+ * }
13384
+ * }
13385
+ * }
13386
+ */
13387
+ "application/json": {
13388
+ data?: unknown;
13389
+ meta?: {
13390
+ [key: string]: unknown;
13391
+ };
13392
+ };
13393
+ };
13394
+ };
13395
+ /** @description Validation error */
13396
+ 400: {
13397
+ headers: {
13398
+ [name: string]: unknown;
13399
+ };
13400
+ content: {
13401
+ "application/json": components["schemas"]["Error"];
13402
+ };
13403
+ };
13404
+ /** @description Unauthorized */
13405
+ 401: {
13406
+ headers: {
13407
+ [name: string]: unknown;
13408
+ };
13409
+ content: {
13410
+ "application/json": components["schemas"]["Error"];
13411
+ };
13412
+ };
13413
+ /** @description Forbidden */
13414
+ 403: {
13415
+ headers: {
13416
+ [name: string]: unknown;
13417
+ };
13418
+ content: {
13419
+ "application/json": components["schemas"]["Error"];
13420
+ };
13421
+ };
13422
+ /** @description Not found */
13423
+ 404: {
13424
+ headers: {
13425
+ [name: string]: unknown;
13426
+ };
13427
+ content: {
13428
+ "application/json": components["schemas"]["Error"];
13429
+ };
13430
+ };
13431
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
13432
+ 409: {
13433
+ headers: {
13434
+ [name: string]: unknown;
13435
+ };
13436
+ content: {
13437
+ "application/json": components["schemas"]["Error"];
13438
+ };
13439
+ };
13440
+ /** @description Rate limited */
13441
+ 429: {
13442
+ headers: {
13443
+ [name: string]: unknown;
13444
+ };
13445
+ content: {
13446
+ "application/json": components["schemas"]["Error"];
13447
+ };
13448
+ };
13449
+ };
13450
+ };
13451
+ trace?: never;
13452
+ };
13157
13453
  "/tenant/settings": {
13158
13454
  parameters: {
13159
13455
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrina/api",
3
- "version": "11.15.0",
3
+ "version": "11.16.0",
4
4
  "description": "Typed TypeScript SDK for the Vitrina API pública — generated from the committed openapi.public.json (ADR 0106).",
5
5
  "type": "module",
6
6
  "license": "MIT",