@vitrina/api 14.9.0 → 14.10.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
@@ -86866,7 +86866,7 @@ interface paths {
86866
86866
  *
86867
86867
  * Which fields apply depends on `channel`: `email` uses `content` (subject, html, from_local, and an opaque `design` blob the builder reloads its canvas from); `whatsapp` uses `template_id` plus `template_params`, which maps each template variable to a contact field or a static value with an optional fallback; `voice` uses neither. Passing `scheduled_at` here records the intent but does NOT schedule the campaign — call `/schedule` for that. Answers 201.
86868
86868
  *
86869
- * `send_mode` (WhatsApp, ADR 0129): `paced` (default) continues across the rolling 24 h windows of the number’s messaging limit by itself; `asap` sends what fits now and pauses (`budget_exhausted`). `pilot_size` (1–1000) sends that many random recipients first and pauses (`pilot`) until resumed.
86869
+ * `send_mode` (WhatsApp, ADR 0129): `paced` (default) continues across the rolling 24 h windows of the number’s messaging limit by itself; `asap` sends what fits now and pauses (`budget_exhausted`). `pilot_size` (1–1000) sends that many random recipients first and pauses (`pilot`) until resumed. `send_window` (WhatsApp): when paced batches may leave — `{ timezone (IANA), days [1–7], start "HH:MM", end "HH:MM" }`, start < end, same day; null = the workspace default. An invalid one is a 400 with `field_errors`.
86870
86870
  */
86871
86871
  post: {
86872
86872
  parameters: {
@@ -86941,6 +86941,7 @@ interface paths {
86941
86941
  send_mode?: "paced" | "asap";
86942
86942
  /** @description Pilot: send this many random recipients first, then pause (paused_reason "pilot") until resumed. Null = no pilot. */
86943
86943
  pilot_size?: number | null;
86944
+ send_window?: components["schemas"]["CampaignSendWindow"] & unknown;
86944
86945
  };
86945
86946
  };
86946
86947
  };
@@ -87075,6 +87076,8 @@ interface paths {
87075
87076
  * @description Meta caps how many unique people a WhatsApp business may START a conversation with (a template outside the customer’s 24 h window) in a rolling 24 h — the messaging-limit tier (TIER_250, TIER_2K, …), shared by the numbers of one portfolio. `budget` is where the number stands: `limit_per_24h` (null = no cap: unlimited, or `tier_unknown`), the unique people messaged in the last 24 h by every template sender (`used_last_24h`, split campaigns / others), the `reserve` campaigns leave for everyone else — max(20 % of the limit, the p95 of the number’s own daily non-campaign usage over 7 days), capped at 80 % — and the `campaign_headroom` left right now.
87076
87077
  *
87077
87078
  * With `recipients`, `plan` says how a campaign to that many people would go: `sendable_now` (its fair share of the headroom, shared with the other campaigns sending on the number), `windows` (sending days), `estimated_completion_at` (continuations move into the workspace’s marketing hours) and the `recommended_send_mode`. `campaign_id` makes a saved campaign’s own recent sends count as its. 404 for a number that is not this workspace’s, 400 for one that is not WhatsApp.
87079
+ *
87080
+ * `send_window` (JSON-encoded, optional) plans against that window — `null` = the workspace default; absent = the saved campaign’s effective window (with `campaign_id`), else the workspace default. The plan then answers `send_window` (resolved), `window_label` («lun–vie 10:00–18:00 (America/Santiago)») and, when it is outside the window now, `next_window_opens_at` — the first batch, `next_batch_at` and `estimated_completion_at` start there, and every continuation lands inside the window. An invalid window is a 400 with `field_errors` (`send_window.start`, …).
87078
87081
  */
87079
87082
  get: {
87080
87083
  parameters: {
@@ -87082,6 +87085,8 @@ interface paths {
87082
87085
  messaging_account_id: string;
87083
87086
  recipients?: number | null;
87084
87087
  campaign_id?: string;
87088
+ /** @description JSON-encoded CampaignSendWindow to plan with (e.g. {"timezone":"America/Santiago","days":[1,2,3,4,5],"start":"10:00","end":"18:00"}), or `null` for the workspace default. Absent = the campaign's effective window (with campaign_id), else the workspace default. */
87089
+ send_window?: string;
87085
87090
  };
87086
87091
  header?: never;
87087
87092
  path?: never;
@@ -87216,7 +87221,7 @@ interface paths {
87216
87221
  };
87217
87222
  /**
87218
87223
  * Fetch one campaign with its stats
87219
- * @description The campaign plus its delivery counters — this is the read to poll while a send is in progress. A WhatsApp campaign that is not finished also carries `pacing` (ADR 0129): its number’s tier and `limit_per_24h`, `sent_last_24h`, `pending`, `waiting` (a paced campaign waiting for the window) with `next_batch_at`, `estimated_completion_at` and `windows_remaining`; null when the budget cannot be read.
87224
+ * @description The campaign plus its delivery counters — this is the read to poll while a send is in progress. A WhatsApp campaign that is not finished also carries `pacing` (ADR 0129): its number’s tier and `limit_per_24h`, `sent_last_24h`, `pending`, `waiting` (a paced campaign waiting for the window) with `next_batch_at`, `estimated_completion_at` and `windows_remaining`, plus the effective `send_window` (`send_window_source`: campaign | workspace), its `window_label` and `next_window_opens_at` (outside the window now); null when the budget cannot be read.
87220
87225
  */
87221
87226
  get: {
87222
87227
  parameters: {
@@ -87450,7 +87455,7 @@ interface paths {
87450
87455
  head?: never;
87451
87456
  /**
87452
87457
  * Edit a campaign
87453
- * @description Legal only while the campaign is `draft` or `scheduled`; from any other status this is a **409**. At least one field is required. `channel` is absent from the body on purpose — a campaign’s channel is fixed at creation, since the content shape depends on it.
87458
+ * @description Legal only while the campaign is `draft` or `scheduled`; from any other status this is a **409** — except a body carrying ONLY `send_window`, which is also legal while `paused` or `sending` and takes effect at the next batch (a campaign waiting for the old window re-plans at once). At least one field is required. `channel` is absent from the body on purpose — a campaign’s channel is fixed at creation, since the content shape depends on it.
87454
87459
  */
87455
87460
  patch: {
87456
87461
  parameters: {
@@ -87506,6 +87511,7 @@ interface paths {
87506
87511
  send_mode?: "paced" | "asap";
87507
87512
  /** @description Pilot: send this many random recipients first, then pause (paused_reason "pilot") until resumed. Null = no pilot. */
87508
87513
  pilot_size?: number | null;
87514
+ send_window?: components["schemas"]["CampaignSendWindow"] & unknown;
87509
87515
  };
87510
87516
  };
87511
87517
  };
@@ -87818,6 +87824,8 @@ interface paths {
87818
87824
  * An EMAIL campaign never leaves from a person's connected mailbox (ADR 0108 §Decision 10, ADR 0032): it goes out through the campaign sending provider under the verified sending domain, and the connected mailbox may only be its Reply-To. A campaign that would resolve to a connected mailbox — the workspace has no verified sending domain but has a connected mailbox, or the From address IS a connected mailbox's address — is refused whole with a **422 `CAMPAIGN_FROM_CONNECTED_MAILBOX`** (`error.details`: `reason` `no_campaign_domain` | `from_is_mailbox`, `address`, `messaging_account_id`), before any recipient is written or queued. This check runs FIRST, before the first-campaign platform approval gate: where mail leaves from is decided before whether the workspace may campaign.
87819
87825
  *
87820
87826
  * Legal from `draft` and `scheduled`; a 409 from anywhere else. Sending is not undoable once recipients start receiving — `/pause` stops the remainder, it does not recall what went out.
87827
+ *
87828
+ * The response is the campaign plus `started: true` and `waiting_for_window_until`: a paced campaign (or a pilot) sent outside its send window sends nothing yet and waits for the window — this is when it opens; null = the first batch leaves now.
87821
87829
  */
87822
87830
  post: {
87823
87831
  parameters: {
@@ -87833,7 +87841,7 @@ interface paths {
87833
87841
  };
87834
87842
  requestBody?: never;
87835
87843
  responses: {
87836
- /** @description The campaign, now scheduled */
87844
+ /** @description The campaign, now scheduled, and whether it waits for its window */
87837
87845
  200: {
87838
87846
  headers: {
87839
87847
  [name: string]: unknown;
@@ -87885,10 +87893,7 @@ interface paths {
87885
87893
  * }
87886
87894
  */
87887
87895
  "application/json": {
87888
- data?: unknown;
87889
- meta?: {
87890
- [key: string]: unknown;
87891
- };
87896
+ data: components["schemas"]["CampaignSendNowResult"];
87892
87897
  };
87893
87898
  };
87894
87899
  };
@@ -179642,6 +179647,17 @@ interface components {
179642
179647
  next_batch_at: string | null;
179643
179648
  computed_at: string;
179644
179649
  };
179650
+ /** @description The window this plan used (resolved); null = contact hours only. */
179651
+ CampaignSendWindow: {
179652
+ /** @description IANA zone the window is read on, e.g. America/Santiago. */
179653
+ timezone: string;
179654
+ /** @description ISO weekdays the window opens on: 1 = Monday … 7 = Sunday. */
179655
+ days: number[];
179656
+ /** @description Local opening time, HH:MM (inclusive). */
179657
+ start: string;
179658
+ /** @description Local closing time, HH:MM (exclusive); later than start. */
179659
+ end: string;
179660
+ } | null;
179645
179661
  CampaignSendPlan: {
179646
179662
  recipients: number;
179647
179663
  sendable_now: number | null;
@@ -179656,11 +179672,22 @@ interface components {
179656
179672
  */
179657
179673
  recommended_send_mode: "paced" | "asap";
179658
179674
  next_batch_at: string | null;
179675
+ send_window: components["schemas"]["CampaignSendWindow"];
179676
+ /** @description e.g. «lun–vie 10:00–18:00 (America/Santiago)»; null = none. */
179677
+ window_label: string | null;
179678
+ /** @description Set when it is outside the window now: the first batch waits until then. */
179679
+ next_window_opens_at: string | null;
179659
179680
  } | null;
179660
179681
  CampaignMessagingBudget: {
179661
179682
  budget: components["schemas"]["MessagingBudget"];
179662
179683
  plan: components["schemas"]["CampaignSendPlan"];
179663
179684
  };
179685
+ CampaignSendNowResult: {
179686
+ /** @enum {boolean} */
179687
+ started: true;
179688
+ /** @description Outside the send window: nothing leaves until this instant (the window opening). Null = sends now. */
179689
+ waiting_for_window_until: string | null;
179690
+ };
179664
179691
  CampaignResumeBody: {
179665
179692
  /**
179666
179693
  * @description paced: continue automatically across the rolling 24 h windows; asap: send what fits now and pause (ADR 0129).
package/dist/index.d.ts CHANGED
@@ -86866,7 +86866,7 @@ interface paths {
86866
86866
  *
86867
86867
  * Which fields apply depends on `channel`: `email` uses `content` (subject, html, from_local, and an opaque `design` blob the builder reloads its canvas from); `whatsapp` uses `template_id` plus `template_params`, which maps each template variable to a contact field or a static value with an optional fallback; `voice` uses neither. Passing `scheduled_at` here records the intent but does NOT schedule the campaign — call `/schedule` for that. Answers 201.
86868
86868
  *
86869
- * `send_mode` (WhatsApp, ADR 0129): `paced` (default) continues across the rolling 24 h windows of the number’s messaging limit by itself; `asap` sends what fits now and pauses (`budget_exhausted`). `pilot_size` (1–1000) sends that many random recipients first and pauses (`pilot`) until resumed.
86869
+ * `send_mode` (WhatsApp, ADR 0129): `paced` (default) continues across the rolling 24 h windows of the number’s messaging limit by itself; `asap` sends what fits now and pauses (`budget_exhausted`). `pilot_size` (1–1000) sends that many random recipients first and pauses (`pilot`) until resumed. `send_window` (WhatsApp): when paced batches may leave — `{ timezone (IANA), days [1–7], start "HH:MM", end "HH:MM" }`, start < end, same day; null = the workspace default. An invalid one is a 400 with `field_errors`.
86870
86870
  */
86871
86871
  post: {
86872
86872
  parameters: {
@@ -86941,6 +86941,7 @@ interface paths {
86941
86941
  send_mode?: "paced" | "asap";
86942
86942
  /** @description Pilot: send this many random recipients first, then pause (paused_reason "pilot") until resumed. Null = no pilot. */
86943
86943
  pilot_size?: number | null;
86944
+ send_window?: components["schemas"]["CampaignSendWindow"] & unknown;
86944
86945
  };
86945
86946
  };
86946
86947
  };
@@ -87075,6 +87076,8 @@ interface paths {
87075
87076
  * @description Meta caps how many unique people a WhatsApp business may START a conversation with (a template outside the customer’s 24 h window) in a rolling 24 h — the messaging-limit tier (TIER_250, TIER_2K, …), shared by the numbers of one portfolio. `budget` is where the number stands: `limit_per_24h` (null = no cap: unlimited, or `tier_unknown`), the unique people messaged in the last 24 h by every template sender (`used_last_24h`, split campaigns / others), the `reserve` campaigns leave for everyone else — max(20 % of the limit, the p95 of the number’s own daily non-campaign usage over 7 days), capped at 80 % — and the `campaign_headroom` left right now.
87076
87077
  *
87077
87078
  * With `recipients`, `plan` says how a campaign to that many people would go: `sendable_now` (its fair share of the headroom, shared with the other campaigns sending on the number), `windows` (sending days), `estimated_completion_at` (continuations move into the workspace’s marketing hours) and the `recommended_send_mode`. `campaign_id` makes a saved campaign’s own recent sends count as its. 404 for a number that is not this workspace’s, 400 for one that is not WhatsApp.
87079
+ *
87080
+ * `send_window` (JSON-encoded, optional) plans against that window — `null` = the workspace default; absent = the saved campaign’s effective window (with `campaign_id`), else the workspace default. The plan then answers `send_window` (resolved), `window_label` («lun–vie 10:00–18:00 (America/Santiago)») and, when it is outside the window now, `next_window_opens_at` — the first batch, `next_batch_at` and `estimated_completion_at` start there, and every continuation lands inside the window. An invalid window is a 400 with `field_errors` (`send_window.start`, …).
87078
87081
  */
87079
87082
  get: {
87080
87083
  parameters: {
@@ -87082,6 +87085,8 @@ interface paths {
87082
87085
  messaging_account_id: string;
87083
87086
  recipients?: number | null;
87084
87087
  campaign_id?: string;
87088
+ /** @description JSON-encoded CampaignSendWindow to plan with (e.g. {"timezone":"America/Santiago","days":[1,2,3,4,5],"start":"10:00","end":"18:00"}), or `null` for the workspace default. Absent = the campaign's effective window (with campaign_id), else the workspace default. */
87089
+ send_window?: string;
87085
87090
  };
87086
87091
  header?: never;
87087
87092
  path?: never;
@@ -87216,7 +87221,7 @@ interface paths {
87216
87221
  };
87217
87222
  /**
87218
87223
  * Fetch one campaign with its stats
87219
- * @description The campaign plus its delivery counters — this is the read to poll while a send is in progress. A WhatsApp campaign that is not finished also carries `pacing` (ADR 0129): its number’s tier and `limit_per_24h`, `sent_last_24h`, `pending`, `waiting` (a paced campaign waiting for the window) with `next_batch_at`, `estimated_completion_at` and `windows_remaining`; null when the budget cannot be read.
87224
+ * @description The campaign plus its delivery counters — this is the read to poll while a send is in progress. A WhatsApp campaign that is not finished also carries `pacing` (ADR 0129): its number’s tier and `limit_per_24h`, `sent_last_24h`, `pending`, `waiting` (a paced campaign waiting for the window) with `next_batch_at`, `estimated_completion_at` and `windows_remaining`, plus the effective `send_window` (`send_window_source`: campaign | workspace), its `window_label` and `next_window_opens_at` (outside the window now); null when the budget cannot be read.
87220
87225
  */
87221
87226
  get: {
87222
87227
  parameters: {
@@ -87450,7 +87455,7 @@ interface paths {
87450
87455
  head?: never;
87451
87456
  /**
87452
87457
  * Edit a campaign
87453
- * @description Legal only while the campaign is `draft` or `scheduled`; from any other status this is a **409**. At least one field is required. `channel` is absent from the body on purpose — a campaign’s channel is fixed at creation, since the content shape depends on it.
87458
+ * @description Legal only while the campaign is `draft` or `scheduled`; from any other status this is a **409** — except a body carrying ONLY `send_window`, which is also legal while `paused` or `sending` and takes effect at the next batch (a campaign waiting for the old window re-plans at once). At least one field is required. `channel` is absent from the body on purpose — a campaign’s channel is fixed at creation, since the content shape depends on it.
87454
87459
  */
87455
87460
  patch: {
87456
87461
  parameters: {
@@ -87506,6 +87511,7 @@ interface paths {
87506
87511
  send_mode?: "paced" | "asap";
87507
87512
  /** @description Pilot: send this many random recipients first, then pause (paused_reason "pilot") until resumed. Null = no pilot. */
87508
87513
  pilot_size?: number | null;
87514
+ send_window?: components["schemas"]["CampaignSendWindow"] & unknown;
87509
87515
  };
87510
87516
  };
87511
87517
  };
@@ -87818,6 +87824,8 @@ interface paths {
87818
87824
  * An EMAIL campaign never leaves from a person's connected mailbox (ADR 0108 §Decision 10, ADR 0032): it goes out through the campaign sending provider under the verified sending domain, and the connected mailbox may only be its Reply-To. A campaign that would resolve to a connected mailbox — the workspace has no verified sending domain but has a connected mailbox, or the From address IS a connected mailbox's address — is refused whole with a **422 `CAMPAIGN_FROM_CONNECTED_MAILBOX`** (`error.details`: `reason` `no_campaign_domain` | `from_is_mailbox`, `address`, `messaging_account_id`), before any recipient is written or queued. This check runs FIRST, before the first-campaign platform approval gate: where mail leaves from is decided before whether the workspace may campaign.
87819
87825
  *
87820
87826
  * Legal from `draft` and `scheduled`; a 409 from anywhere else. Sending is not undoable once recipients start receiving — `/pause` stops the remainder, it does not recall what went out.
87827
+ *
87828
+ * The response is the campaign plus `started: true` and `waiting_for_window_until`: a paced campaign (or a pilot) sent outside its send window sends nothing yet and waits for the window — this is when it opens; null = the first batch leaves now.
87821
87829
  */
87822
87830
  post: {
87823
87831
  parameters: {
@@ -87833,7 +87841,7 @@ interface paths {
87833
87841
  };
87834
87842
  requestBody?: never;
87835
87843
  responses: {
87836
- /** @description The campaign, now scheduled */
87844
+ /** @description The campaign, now scheduled, and whether it waits for its window */
87837
87845
  200: {
87838
87846
  headers: {
87839
87847
  [name: string]: unknown;
@@ -87885,10 +87893,7 @@ interface paths {
87885
87893
  * }
87886
87894
  */
87887
87895
  "application/json": {
87888
- data?: unknown;
87889
- meta?: {
87890
- [key: string]: unknown;
87891
- };
87896
+ data: components["schemas"]["CampaignSendNowResult"];
87892
87897
  };
87893
87898
  };
87894
87899
  };
@@ -179642,6 +179647,17 @@ interface components {
179642
179647
  next_batch_at: string | null;
179643
179648
  computed_at: string;
179644
179649
  };
179650
+ /** @description The window this plan used (resolved); null = contact hours only. */
179651
+ CampaignSendWindow: {
179652
+ /** @description IANA zone the window is read on, e.g. America/Santiago. */
179653
+ timezone: string;
179654
+ /** @description ISO weekdays the window opens on: 1 = Monday … 7 = Sunday. */
179655
+ days: number[];
179656
+ /** @description Local opening time, HH:MM (inclusive). */
179657
+ start: string;
179658
+ /** @description Local closing time, HH:MM (exclusive); later than start. */
179659
+ end: string;
179660
+ } | null;
179645
179661
  CampaignSendPlan: {
179646
179662
  recipients: number;
179647
179663
  sendable_now: number | null;
@@ -179656,11 +179672,22 @@ interface components {
179656
179672
  */
179657
179673
  recommended_send_mode: "paced" | "asap";
179658
179674
  next_batch_at: string | null;
179675
+ send_window: components["schemas"]["CampaignSendWindow"];
179676
+ /** @description e.g. «lun–vie 10:00–18:00 (America/Santiago)»; null = none. */
179677
+ window_label: string | null;
179678
+ /** @description Set when it is outside the window now: the first batch waits until then. */
179679
+ next_window_opens_at: string | null;
179659
179680
  } | null;
179660
179681
  CampaignMessagingBudget: {
179661
179682
  budget: components["schemas"]["MessagingBudget"];
179662
179683
  plan: components["schemas"]["CampaignSendPlan"];
179663
179684
  };
179685
+ CampaignSendNowResult: {
179686
+ /** @enum {boolean} */
179687
+ started: true;
179688
+ /** @description Outside the send window: nothing leaves until this instant (the window opening). Null = sends now. */
179689
+ waiting_for_window_until: string | null;
179690
+ };
179664
179691
  CampaignResumeBody: {
179665
179692
  /**
179666
179693
  * @description paced: continue automatically across the rolling 24 h windows; asap: send what fits now and pause (ADR 0129).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrina/api",
3
- "version": "14.9.0",
3
+ "version": "14.10.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",