@vitrina/api 14.12.0 → 14.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -88914,7 +88914,9 @@ interface paths {
88914
88914
  };
88915
88915
  /**
88916
88916
  * Meta’s own analytics for the campaign’s template
88917
- * @description Meta’s per-template analytics (sent, delivered, read, button clicks) over the campaign’s dates (the 200 shape below is the planned one). **Not available yet**: the messaging bridge Vitrina reaches Meta through does not expose WhatsApp template analytics yet (ADR 0137). Answers **501 `meta_insights_unavailable`** until it does; 404 for an unknown campaign.
88917
+ * @description Meta’s per-template analytics — sent, delivered, read, clicks per button (quick-reply AND URL buttons) and cost — for the campaign’s WhatsApp template over its days (`started_at` → `finished_at` or now, padded to whole UTC days, at most the last 90), read through the messaging bridge (ADR 0137) and cached 15 minutes. These are the TEMPLATE’s numbers over those days: another campaign sending the same template on the same days shares them.
88918
+ *
88919
+ * **202** `{ data: { status: "enabling", retry_after_seconds } }` the first time, while Meta switches the account’s template insights on — ask again after `retry_after_seconds`. 409 when the campaign has not started; 422 for a campaign that is not a WhatsApp template campaign; 404 when the bridge does not know the template; 429 (with `retry_after_seconds`) when Meta throttles; 502 when Meta is unavailable; 501 `meta_insights_unavailable` when Meta’s numbers cannot exist for the account: `reason` `not_on_bridge` (not connected through the bridge) or `coexistence` (a WhatsApp Business app number — Meta refuses template insights there).
88918
88920
  */
88919
88921
  get: {
88920
88922
  parameters: {
@@ -88936,6 +88938,7 @@ interface paths {
88936
88938
  /**
88937
88939
  * @example {
88938
88940
  * "data": {
88941
+ * "status": "ready",
88939
88942
  * "template": {
88940
88943
  * "name": "promo_octubre",
88941
88944
  * "language": "es",
@@ -88950,7 +88953,7 @@ interface paths {
88950
88953
  * "delivered": 790,
88951
88954
  * "read": 512,
88952
88955
  * "cost": {
88953
- * "amount": 41.2,
88956
+ * "amount": "41.2",
88954
88957
  * "currency": "USD"
88955
88958
  * }
88956
88959
  * },
@@ -88980,7 +88983,21 @@ interface paths {
88980
88983
  * }
88981
88984
  */
88982
88985
  "application/json": {
88983
- data?: unknown;
88986
+ data: components["schemas"]["CampaignMetaInsights"];
88987
+ meta?: {
88988
+ [key: string]: unknown;
88989
+ };
88990
+ };
88991
+ };
88992
+ };
88993
+ /** @description Meta is switching the template insights on — retry later */
88994
+ 202: {
88995
+ headers: {
88996
+ [name: string]: unknown;
88997
+ };
88998
+ content: {
88999
+ "application/json": {
89000
+ data: components["schemas"]["CampaignMetaInsights"];
88984
89001
  meta?: {
88985
89002
  [key: string]: unknown;
88986
89003
  };
@@ -89041,7 +89058,7 @@ interface paths {
89041
89058
  "application/json": components["schemas"]["Error"];
89042
89059
  };
89043
89060
  };
89044
- /** @description `meta_insights_unavailable` — not available yet. */
89061
+ /** @description `meta_insights_unavailable` — the account is not connected through the bridge. */
89045
89062
  501: {
89046
89063
  headers: {
89047
89064
  [name: string]: unknown;
@@ -180268,6 +180285,55 @@ interface components {
180268
180285
  }[];
180269
180286
  };
180270
180287
  };
180288
+ CampaignMetaInsights: {
180289
+ /** @enum {string} */
180290
+ status: "ready";
180291
+ template: {
180292
+ name: string;
180293
+ language: string;
180294
+ /** @description Meta template id. */
180295
+ external_id: string;
180296
+ };
180297
+ range: {
180298
+ /** @description First UTC day (YYYY-MM-DD), inclusive. */
180299
+ start: string;
180300
+ /** @description Last UTC day (YYYY-MM-DD), inclusive. */
180301
+ end: string;
180302
+ };
180303
+ totals: {
180304
+ sent: number;
180305
+ delivered: number;
180306
+ read: number;
180307
+ cost: {
180308
+ /** @description Decimal string in `currency`. */
180309
+ amount: string;
180310
+ currency: string | null;
180311
+ };
180312
+ };
180313
+ /** @description Clicks per button over the range, most-clicked first. */
180314
+ clicks: {
180315
+ /** @description Meta button type: `quick_reply_button`, `url_button`, … */
180316
+ type: string;
180317
+ /** @description Button text. */
180318
+ button: string;
180319
+ count: number;
180320
+ }[];
180321
+ daily: {
180322
+ /** @description UTC day. */
180323
+ date: string;
180324
+ sent: number;
180325
+ delivered: number;
180326
+ read: number;
180327
+ clicks: number;
180328
+ }[];
180329
+ /** @description When Meta was read (cached up to 15 min). */
180330
+ fetched_at: string;
180331
+ } | {
180332
+ /** @enum {string} */
180333
+ status: "enabling";
180334
+ /** @description Meta is switching the account’s template insights on; ask again after this. */
180335
+ retry_after_seconds: number;
180336
+ };
180271
180337
  CampaignTestSendResult: {
180272
180338
  /** Format: uuid */
180273
180339
  campaign_id: string;
package/dist/index.d.ts CHANGED
@@ -88914,7 +88914,9 @@ interface paths {
88914
88914
  };
88915
88915
  /**
88916
88916
  * Meta’s own analytics for the campaign’s template
88917
- * @description Meta’s per-template analytics (sent, delivered, read, button clicks) over the campaign’s dates (the 200 shape below is the planned one). **Not available yet**: the messaging bridge Vitrina reaches Meta through does not expose WhatsApp template analytics yet (ADR 0137). Answers **501 `meta_insights_unavailable`** until it does; 404 for an unknown campaign.
88917
+ * @description Meta’s per-template analytics — sent, delivered, read, clicks per button (quick-reply AND URL buttons) and cost — for the campaign’s WhatsApp template over its days (`started_at` → `finished_at` or now, padded to whole UTC days, at most the last 90), read through the messaging bridge (ADR 0137) and cached 15 minutes. These are the TEMPLATE’s numbers over those days: another campaign sending the same template on the same days shares them.
88918
+ *
88919
+ * **202** `{ data: { status: "enabling", retry_after_seconds } }` the first time, while Meta switches the account’s template insights on — ask again after `retry_after_seconds`. 409 when the campaign has not started; 422 for a campaign that is not a WhatsApp template campaign; 404 when the bridge does not know the template; 429 (with `retry_after_seconds`) when Meta throttles; 502 when Meta is unavailable; 501 `meta_insights_unavailable` when Meta’s numbers cannot exist for the account: `reason` `not_on_bridge` (not connected through the bridge) or `coexistence` (a WhatsApp Business app number — Meta refuses template insights there).
88918
88920
  */
88919
88921
  get: {
88920
88922
  parameters: {
@@ -88936,6 +88938,7 @@ interface paths {
88936
88938
  /**
88937
88939
  * @example {
88938
88940
  * "data": {
88941
+ * "status": "ready",
88939
88942
  * "template": {
88940
88943
  * "name": "promo_octubre",
88941
88944
  * "language": "es",
@@ -88950,7 +88953,7 @@ interface paths {
88950
88953
  * "delivered": 790,
88951
88954
  * "read": 512,
88952
88955
  * "cost": {
88953
- * "amount": 41.2,
88956
+ * "amount": "41.2",
88954
88957
  * "currency": "USD"
88955
88958
  * }
88956
88959
  * },
@@ -88980,7 +88983,21 @@ interface paths {
88980
88983
  * }
88981
88984
  */
88982
88985
  "application/json": {
88983
- data?: unknown;
88986
+ data: components["schemas"]["CampaignMetaInsights"];
88987
+ meta?: {
88988
+ [key: string]: unknown;
88989
+ };
88990
+ };
88991
+ };
88992
+ };
88993
+ /** @description Meta is switching the template insights on — retry later */
88994
+ 202: {
88995
+ headers: {
88996
+ [name: string]: unknown;
88997
+ };
88998
+ content: {
88999
+ "application/json": {
89000
+ data: components["schemas"]["CampaignMetaInsights"];
88984
89001
  meta?: {
88985
89002
  [key: string]: unknown;
88986
89003
  };
@@ -89041,7 +89058,7 @@ interface paths {
89041
89058
  "application/json": components["schemas"]["Error"];
89042
89059
  };
89043
89060
  };
89044
- /** @description `meta_insights_unavailable` — not available yet. */
89061
+ /** @description `meta_insights_unavailable` — the account is not connected through the bridge. */
89045
89062
  501: {
89046
89063
  headers: {
89047
89064
  [name: string]: unknown;
@@ -180268,6 +180285,55 @@ interface components {
180268
180285
  }[];
180269
180286
  };
180270
180287
  };
180288
+ CampaignMetaInsights: {
180289
+ /** @enum {string} */
180290
+ status: "ready";
180291
+ template: {
180292
+ name: string;
180293
+ language: string;
180294
+ /** @description Meta template id. */
180295
+ external_id: string;
180296
+ };
180297
+ range: {
180298
+ /** @description First UTC day (YYYY-MM-DD), inclusive. */
180299
+ start: string;
180300
+ /** @description Last UTC day (YYYY-MM-DD), inclusive. */
180301
+ end: string;
180302
+ };
180303
+ totals: {
180304
+ sent: number;
180305
+ delivered: number;
180306
+ read: number;
180307
+ cost: {
180308
+ /** @description Decimal string in `currency`. */
180309
+ amount: string;
180310
+ currency: string | null;
180311
+ };
180312
+ };
180313
+ /** @description Clicks per button over the range, most-clicked first. */
180314
+ clicks: {
180315
+ /** @description Meta button type: `quick_reply_button`, `url_button`, … */
180316
+ type: string;
180317
+ /** @description Button text. */
180318
+ button: string;
180319
+ count: number;
180320
+ }[];
180321
+ daily: {
180322
+ /** @description UTC day. */
180323
+ date: string;
180324
+ sent: number;
180325
+ delivered: number;
180326
+ read: number;
180327
+ clicks: number;
180328
+ }[];
180329
+ /** @description When Meta was read (cached up to 15 min). */
180330
+ fetched_at: string;
180331
+ } | {
180332
+ /** @enum {string} */
180333
+ status: "enabling";
180334
+ /** @description Meta is switching the account’s template insights on; ask again after this. */
180335
+ retry_after_seconds: number;
180336
+ };
180271
180337
  CampaignTestSendResult: {
180272
180338
  /** Format: uuid */
180273
180339
  campaign_id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrina/api",
3
- "version": "14.12.0",
3
+ "version": "14.13.1",
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",