@vitrina/api 15.10.2 → 15.11.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 +199 -0
- package/dist/index.d.ts +199 -0
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -93804,6 +93804,194 @@ interface paths {
|
|
|
93804
93804
|
};
|
|
93805
93805
|
trace?: never;
|
|
93806
93806
|
};
|
|
93807
|
+
"/campaigns/{id}/header-media": {
|
|
93808
|
+
parameters: {
|
|
93809
|
+
query?: never;
|
|
93810
|
+
header?: never;
|
|
93811
|
+
path?: never;
|
|
93812
|
+
cookie?: never;
|
|
93813
|
+
};
|
|
93814
|
+
get?: never;
|
|
93815
|
+
/**
|
|
93816
|
+
* Change a WhatsApp campaign's media-header picture
|
|
93817
|
+
* @description Replaces the media header (image / video / PDF) of a WhatsApp campaign — the one change still legal while it is `sending` or `paused` besides the send window/schedule; also legal in `draft` and `scheduled`. Body `{ url }`: a public https link (e.g. from `POST /whatsapp-templates/header-media`).
|
|
93818
|
+
*
|
|
93819
|
+
* In one transaction it sets `template_params.header_media = { source: 'static', value: url }` and rewrites the frozen `params.header_media` of every recipient still `pending`, so each one not yet sent gets the new picture. Recipients already sent, delivered, read or failed are history and keep the one they received. A batch the worker had already picked up when this commits may still leave with the old picture; the next batch carries the new one.
|
|
93820
|
+
*
|
|
93821
|
+
* The **200** is the campaign detail (the same `data` as `GET /campaigns/{id}`) with `meta.updated_recipients` — how many pending recipients changed.
|
|
93822
|
+
*
|
|
93823
|
+
* Refusals (`error.details.reason`): **409 `campaign_closed`** — the campaign is `sent` or `cancelled`; **400 `header_media_not_supported`** — not a WhatsApp campaign, or its template has no media header; **400 `header_media_invalid`** — the url is not a public https link (the same rule as `template_params.header_media` on create/PATCH). Fires the `campaign.updated` realtime event.
|
|
93824
|
+
*/
|
|
93825
|
+
put: {
|
|
93826
|
+
parameters: {
|
|
93827
|
+
query?: never;
|
|
93828
|
+
header?: never;
|
|
93829
|
+
path: {
|
|
93830
|
+
id: string;
|
|
93831
|
+
};
|
|
93832
|
+
cookie?: never;
|
|
93833
|
+
};
|
|
93834
|
+
requestBody?: {
|
|
93835
|
+
content: {
|
|
93836
|
+
/**
|
|
93837
|
+
* @example {
|
|
93838
|
+
* "url": "https://media.example.com/promo-noviembre.jpg"
|
|
93839
|
+
* }
|
|
93840
|
+
*/
|
|
93841
|
+
"application/json": components["schemas"]["CampaignHeaderMediaBody"];
|
|
93842
|
+
};
|
|
93843
|
+
};
|
|
93844
|
+
responses: {
|
|
93845
|
+
/** @description The campaign detail and how many pending recipients got the new link */
|
|
93846
|
+
200: {
|
|
93847
|
+
headers: {
|
|
93848
|
+
[name: string]: unknown;
|
|
93849
|
+
};
|
|
93850
|
+
content: {
|
|
93851
|
+
/**
|
|
93852
|
+
* @example {
|
|
93853
|
+
* "data": {
|
|
93854
|
+
* "id": "7a7a7a7a-0000-4000-8000-0000000000c1",
|
|
93855
|
+
* "name": "Recordatorio de control",
|
|
93856
|
+
* "channel": "whatsapp",
|
|
93857
|
+
* "status": "sending",
|
|
93858
|
+
* "tenant_id": "7a7a7a7a-0000-4000-8000-000000000001",
|
|
93859
|
+
* "audience_id": "7a7a7a7a-0000-4000-8000-0000000000a1",
|
|
93860
|
+
* "messaging_account_id": "7a7a7a7a-0000-4000-8000-0000000000b1",
|
|
93861
|
+
* "template_id": "7a7a7a7a-0000-4000-8000-0000000000d1",
|
|
93862
|
+
* "template_params": {
|
|
93863
|
+
* "1": {
|
|
93864
|
+
* "source": "contact_field",
|
|
93865
|
+
* "field": "first_name",
|
|
93866
|
+
* "fallback": "cliente"
|
|
93867
|
+
* },
|
|
93868
|
+
* "2": {
|
|
93869
|
+
* "source": "static",
|
|
93870
|
+
* "value": "15 de noviembre"
|
|
93871
|
+
* },
|
|
93872
|
+
* "header_media": {
|
|
93873
|
+
* "source": "static",
|
|
93874
|
+
* "value": "https://media.example.com/promo-noviembre.jpg"
|
|
93875
|
+
* }
|
|
93876
|
+
* },
|
|
93877
|
+
* "content": {},
|
|
93878
|
+
* "reply_mode": "account_default",
|
|
93879
|
+
* "scheduled_at": null,
|
|
93880
|
+
* "started_at": "2026-10-01T15:00:00.000Z",
|
|
93881
|
+
* "finished_at": null,
|
|
93882
|
+
* "paused_reason": null,
|
|
93883
|
+
* "send_mode": "paced",
|
|
93884
|
+
* "pilot_size": null,
|
|
93885
|
+
* "pilot_completed_at": null,
|
|
93886
|
+
* "pacing_next_batch_at": null,
|
|
93887
|
+
* "total_recipients": 500,
|
|
93888
|
+
* "suppressed_count": 12,
|
|
93889
|
+
* "sent_count": 120,
|
|
93890
|
+
* "delivered_count": 110,
|
|
93891
|
+
* "read_count": 64,
|
|
93892
|
+
* "failed_count": 0,
|
|
93893
|
+
* "replied_count": 0,
|
|
93894
|
+
* "created_by": "7a7a7a7a-0000-4000-8000-000000000011",
|
|
93895
|
+
* "created_at": "2026-10-01T14:00:00.000Z",
|
|
93896
|
+
* "updated_at": "2026-10-01T15:10:00.000Z",
|
|
93897
|
+
* "recipient_counts": {
|
|
93898
|
+
* "pending": 380,
|
|
93899
|
+
* "sent": 10,
|
|
93900
|
+
* "delivered": 46,
|
|
93901
|
+
* "read": 64,
|
|
93902
|
+
* "failed": 0,
|
|
93903
|
+
* "suppressed": 12
|
|
93904
|
+
* },
|
|
93905
|
+
* "pacing": {
|
|
93906
|
+
* "send_mode": "paced",
|
|
93907
|
+
* "tier": "TIER_1K",
|
|
93908
|
+
* "tier_unknown": false,
|
|
93909
|
+
* "limit_per_24h": 1000,
|
|
93910
|
+
* "sent_last_24h": 120,
|
|
93911
|
+
* "pending": 380,
|
|
93912
|
+
* "waiting": false,
|
|
93913
|
+
* "next_batch_at": null,
|
|
93914
|
+
* "estimated_completion_at": "2026-10-01T16:00:00.000Z",
|
|
93915
|
+
* "windows_remaining": 1,
|
|
93916
|
+
* "sendable_now": 380,
|
|
93917
|
+
* "campaign_headroom": 760
|
|
93918
|
+
* },
|
|
93919
|
+
* "paused_detail": null
|
|
93920
|
+
* },
|
|
93921
|
+
* "meta": {
|
|
93922
|
+
* "updated_recipients": 380
|
|
93923
|
+
* }
|
|
93924
|
+
* }
|
|
93925
|
+
*/
|
|
93926
|
+
"application/json": {
|
|
93927
|
+
data?: unknown;
|
|
93928
|
+
meta: components["schemas"]["CampaignHeaderMediaMeta"];
|
|
93929
|
+
};
|
|
93930
|
+
};
|
|
93931
|
+
};
|
|
93932
|
+
/** @description Validation error */
|
|
93933
|
+
400: {
|
|
93934
|
+
headers: {
|
|
93935
|
+
[name: string]: unknown;
|
|
93936
|
+
};
|
|
93937
|
+
content: {
|
|
93938
|
+
"application/json": components["schemas"]["Error"];
|
|
93939
|
+
};
|
|
93940
|
+
};
|
|
93941
|
+
/** @description Unauthorized */
|
|
93942
|
+
401: {
|
|
93943
|
+
headers: {
|
|
93944
|
+
[name: string]: unknown;
|
|
93945
|
+
};
|
|
93946
|
+
content: {
|
|
93947
|
+
"application/json": components["schemas"]["Error"];
|
|
93948
|
+
};
|
|
93949
|
+
};
|
|
93950
|
+
/** @description Forbidden */
|
|
93951
|
+
403: {
|
|
93952
|
+
headers: {
|
|
93953
|
+
[name: string]: unknown;
|
|
93954
|
+
};
|
|
93955
|
+
content: {
|
|
93956
|
+
"application/json": components["schemas"]["Error"];
|
|
93957
|
+
};
|
|
93958
|
+
};
|
|
93959
|
+
/** @description Not found */
|
|
93960
|
+
404: {
|
|
93961
|
+
headers: {
|
|
93962
|
+
[name: string]: unknown;
|
|
93963
|
+
};
|
|
93964
|
+
content: {
|
|
93965
|
+
"application/json": components["schemas"]["Error"];
|
|
93966
|
+
};
|
|
93967
|
+
};
|
|
93968
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
93969
|
+
409: {
|
|
93970
|
+
headers: {
|
|
93971
|
+
[name: string]: unknown;
|
|
93972
|
+
};
|
|
93973
|
+
content: {
|
|
93974
|
+
"application/json": components["schemas"]["Error"];
|
|
93975
|
+
};
|
|
93976
|
+
};
|
|
93977
|
+
/** @description Rate limited */
|
|
93978
|
+
429: {
|
|
93979
|
+
headers: {
|
|
93980
|
+
[name: string]: unknown;
|
|
93981
|
+
};
|
|
93982
|
+
content: {
|
|
93983
|
+
"application/json": components["schemas"]["Error"];
|
|
93984
|
+
};
|
|
93985
|
+
};
|
|
93986
|
+
};
|
|
93987
|
+
};
|
|
93988
|
+
post?: never;
|
|
93989
|
+
delete?: never;
|
|
93990
|
+
options?: never;
|
|
93991
|
+
head?: never;
|
|
93992
|
+
patch?: never;
|
|
93993
|
+
trace?: never;
|
|
93994
|
+
};
|
|
93807
93995
|
"/campaigns/{id}/schedule": {
|
|
93808
93996
|
parameters: {
|
|
93809
93997
|
query?: never;
|
|
@@ -237608,6 +237796,17 @@ interface components {
|
|
|
237608
237796
|
budget: components["schemas"]["MessagingBudget"];
|
|
237609
237797
|
plan: components["schemas"]["CampaignSendPlan"];
|
|
237610
237798
|
};
|
|
237799
|
+
CampaignHeaderMediaMeta: {
|
|
237800
|
+
/** @description Recipients still `pending` whose frozen params now carry the new link. Already sent / delivered / read / failed ones are history and keep theirs. */
|
|
237801
|
+
updated_recipients: number;
|
|
237802
|
+
};
|
|
237803
|
+
CampaignHeaderMediaBody: {
|
|
237804
|
+
/**
|
|
237805
|
+
* @description Public https link to the image / video / PDF (e.g. the `url` `POST /whatsapp-templates/header-media` returns).
|
|
237806
|
+
* @example https://media.example.com/promo-noviembre.jpg
|
|
237807
|
+
*/
|
|
237808
|
+
url: string;
|
|
237809
|
+
};
|
|
237611
237810
|
CampaignSendNowResult: {
|
|
237612
237811
|
/** @enum {boolean} */
|
|
237613
237812
|
started: true;
|
package/dist/index.d.ts
CHANGED
|
@@ -93804,6 +93804,194 @@ interface paths {
|
|
|
93804
93804
|
};
|
|
93805
93805
|
trace?: never;
|
|
93806
93806
|
};
|
|
93807
|
+
"/campaigns/{id}/header-media": {
|
|
93808
|
+
parameters: {
|
|
93809
|
+
query?: never;
|
|
93810
|
+
header?: never;
|
|
93811
|
+
path?: never;
|
|
93812
|
+
cookie?: never;
|
|
93813
|
+
};
|
|
93814
|
+
get?: never;
|
|
93815
|
+
/**
|
|
93816
|
+
* Change a WhatsApp campaign's media-header picture
|
|
93817
|
+
* @description Replaces the media header (image / video / PDF) of a WhatsApp campaign — the one change still legal while it is `sending` or `paused` besides the send window/schedule; also legal in `draft` and `scheduled`. Body `{ url }`: a public https link (e.g. from `POST /whatsapp-templates/header-media`).
|
|
93818
|
+
*
|
|
93819
|
+
* In one transaction it sets `template_params.header_media = { source: 'static', value: url }` and rewrites the frozen `params.header_media` of every recipient still `pending`, so each one not yet sent gets the new picture. Recipients already sent, delivered, read or failed are history and keep the one they received. A batch the worker had already picked up when this commits may still leave with the old picture; the next batch carries the new one.
|
|
93820
|
+
*
|
|
93821
|
+
* The **200** is the campaign detail (the same `data` as `GET /campaigns/{id}`) with `meta.updated_recipients` — how many pending recipients changed.
|
|
93822
|
+
*
|
|
93823
|
+
* Refusals (`error.details.reason`): **409 `campaign_closed`** — the campaign is `sent` or `cancelled`; **400 `header_media_not_supported`** — not a WhatsApp campaign, or its template has no media header; **400 `header_media_invalid`** — the url is not a public https link (the same rule as `template_params.header_media` on create/PATCH). Fires the `campaign.updated` realtime event.
|
|
93824
|
+
*/
|
|
93825
|
+
put: {
|
|
93826
|
+
parameters: {
|
|
93827
|
+
query?: never;
|
|
93828
|
+
header?: never;
|
|
93829
|
+
path: {
|
|
93830
|
+
id: string;
|
|
93831
|
+
};
|
|
93832
|
+
cookie?: never;
|
|
93833
|
+
};
|
|
93834
|
+
requestBody?: {
|
|
93835
|
+
content: {
|
|
93836
|
+
/**
|
|
93837
|
+
* @example {
|
|
93838
|
+
* "url": "https://media.example.com/promo-noviembre.jpg"
|
|
93839
|
+
* }
|
|
93840
|
+
*/
|
|
93841
|
+
"application/json": components["schemas"]["CampaignHeaderMediaBody"];
|
|
93842
|
+
};
|
|
93843
|
+
};
|
|
93844
|
+
responses: {
|
|
93845
|
+
/** @description The campaign detail and how many pending recipients got the new link */
|
|
93846
|
+
200: {
|
|
93847
|
+
headers: {
|
|
93848
|
+
[name: string]: unknown;
|
|
93849
|
+
};
|
|
93850
|
+
content: {
|
|
93851
|
+
/**
|
|
93852
|
+
* @example {
|
|
93853
|
+
* "data": {
|
|
93854
|
+
* "id": "7a7a7a7a-0000-4000-8000-0000000000c1",
|
|
93855
|
+
* "name": "Recordatorio de control",
|
|
93856
|
+
* "channel": "whatsapp",
|
|
93857
|
+
* "status": "sending",
|
|
93858
|
+
* "tenant_id": "7a7a7a7a-0000-4000-8000-000000000001",
|
|
93859
|
+
* "audience_id": "7a7a7a7a-0000-4000-8000-0000000000a1",
|
|
93860
|
+
* "messaging_account_id": "7a7a7a7a-0000-4000-8000-0000000000b1",
|
|
93861
|
+
* "template_id": "7a7a7a7a-0000-4000-8000-0000000000d1",
|
|
93862
|
+
* "template_params": {
|
|
93863
|
+
* "1": {
|
|
93864
|
+
* "source": "contact_field",
|
|
93865
|
+
* "field": "first_name",
|
|
93866
|
+
* "fallback": "cliente"
|
|
93867
|
+
* },
|
|
93868
|
+
* "2": {
|
|
93869
|
+
* "source": "static",
|
|
93870
|
+
* "value": "15 de noviembre"
|
|
93871
|
+
* },
|
|
93872
|
+
* "header_media": {
|
|
93873
|
+
* "source": "static",
|
|
93874
|
+
* "value": "https://media.example.com/promo-noviembre.jpg"
|
|
93875
|
+
* }
|
|
93876
|
+
* },
|
|
93877
|
+
* "content": {},
|
|
93878
|
+
* "reply_mode": "account_default",
|
|
93879
|
+
* "scheduled_at": null,
|
|
93880
|
+
* "started_at": "2026-10-01T15:00:00.000Z",
|
|
93881
|
+
* "finished_at": null,
|
|
93882
|
+
* "paused_reason": null,
|
|
93883
|
+
* "send_mode": "paced",
|
|
93884
|
+
* "pilot_size": null,
|
|
93885
|
+
* "pilot_completed_at": null,
|
|
93886
|
+
* "pacing_next_batch_at": null,
|
|
93887
|
+
* "total_recipients": 500,
|
|
93888
|
+
* "suppressed_count": 12,
|
|
93889
|
+
* "sent_count": 120,
|
|
93890
|
+
* "delivered_count": 110,
|
|
93891
|
+
* "read_count": 64,
|
|
93892
|
+
* "failed_count": 0,
|
|
93893
|
+
* "replied_count": 0,
|
|
93894
|
+
* "created_by": "7a7a7a7a-0000-4000-8000-000000000011",
|
|
93895
|
+
* "created_at": "2026-10-01T14:00:00.000Z",
|
|
93896
|
+
* "updated_at": "2026-10-01T15:10:00.000Z",
|
|
93897
|
+
* "recipient_counts": {
|
|
93898
|
+
* "pending": 380,
|
|
93899
|
+
* "sent": 10,
|
|
93900
|
+
* "delivered": 46,
|
|
93901
|
+
* "read": 64,
|
|
93902
|
+
* "failed": 0,
|
|
93903
|
+
* "suppressed": 12
|
|
93904
|
+
* },
|
|
93905
|
+
* "pacing": {
|
|
93906
|
+
* "send_mode": "paced",
|
|
93907
|
+
* "tier": "TIER_1K",
|
|
93908
|
+
* "tier_unknown": false,
|
|
93909
|
+
* "limit_per_24h": 1000,
|
|
93910
|
+
* "sent_last_24h": 120,
|
|
93911
|
+
* "pending": 380,
|
|
93912
|
+
* "waiting": false,
|
|
93913
|
+
* "next_batch_at": null,
|
|
93914
|
+
* "estimated_completion_at": "2026-10-01T16:00:00.000Z",
|
|
93915
|
+
* "windows_remaining": 1,
|
|
93916
|
+
* "sendable_now": 380,
|
|
93917
|
+
* "campaign_headroom": 760
|
|
93918
|
+
* },
|
|
93919
|
+
* "paused_detail": null
|
|
93920
|
+
* },
|
|
93921
|
+
* "meta": {
|
|
93922
|
+
* "updated_recipients": 380
|
|
93923
|
+
* }
|
|
93924
|
+
* }
|
|
93925
|
+
*/
|
|
93926
|
+
"application/json": {
|
|
93927
|
+
data?: unknown;
|
|
93928
|
+
meta: components["schemas"]["CampaignHeaderMediaMeta"];
|
|
93929
|
+
};
|
|
93930
|
+
};
|
|
93931
|
+
};
|
|
93932
|
+
/** @description Validation error */
|
|
93933
|
+
400: {
|
|
93934
|
+
headers: {
|
|
93935
|
+
[name: string]: unknown;
|
|
93936
|
+
};
|
|
93937
|
+
content: {
|
|
93938
|
+
"application/json": components["schemas"]["Error"];
|
|
93939
|
+
};
|
|
93940
|
+
};
|
|
93941
|
+
/** @description Unauthorized */
|
|
93942
|
+
401: {
|
|
93943
|
+
headers: {
|
|
93944
|
+
[name: string]: unknown;
|
|
93945
|
+
};
|
|
93946
|
+
content: {
|
|
93947
|
+
"application/json": components["schemas"]["Error"];
|
|
93948
|
+
};
|
|
93949
|
+
};
|
|
93950
|
+
/** @description Forbidden */
|
|
93951
|
+
403: {
|
|
93952
|
+
headers: {
|
|
93953
|
+
[name: string]: unknown;
|
|
93954
|
+
};
|
|
93955
|
+
content: {
|
|
93956
|
+
"application/json": components["schemas"]["Error"];
|
|
93957
|
+
};
|
|
93958
|
+
};
|
|
93959
|
+
/** @description Not found */
|
|
93960
|
+
404: {
|
|
93961
|
+
headers: {
|
|
93962
|
+
[name: string]: unknown;
|
|
93963
|
+
};
|
|
93964
|
+
content: {
|
|
93965
|
+
"application/json": components["schemas"]["Error"];
|
|
93966
|
+
};
|
|
93967
|
+
};
|
|
93968
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
93969
|
+
409: {
|
|
93970
|
+
headers: {
|
|
93971
|
+
[name: string]: unknown;
|
|
93972
|
+
};
|
|
93973
|
+
content: {
|
|
93974
|
+
"application/json": components["schemas"]["Error"];
|
|
93975
|
+
};
|
|
93976
|
+
};
|
|
93977
|
+
/** @description Rate limited */
|
|
93978
|
+
429: {
|
|
93979
|
+
headers: {
|
|
93980
|
+
[name: string]: unknown;
|
|
93981
|
+
};
|
|
93982
|
+
content: {
|
|
93983
|
+
"application/json": components["schemas"]["Error"];
|
|
93984
|
+
};
|
|
93985
|
+
};
|
|
93986
|
+
};
|
|
93987
|
+
};
|
|
93988
|
+
post?: never;
|
|
93989
|
+
delete?: never;
|
|
93990
|
+
options?: never;
|
|
93991
|
+
head?: never;
|
|
93992
|
+
patch?: never;
|
|
93993
|
+
trace?: never;
|
|
93994
|
+
};
|
|
93807
93995
|
"/campaigns/{id}/schedule": {
|
|
93808
93996
|
parameters: {
|
|
93809
93997
|
query?: never;
|
|
@@ -237608,6 +237796,17 @@ interface components {
|
|
|
237608
237796
|
budget: components["schemas"]["MessagingBudget"];
|
|
237609
237797
|
plan: components["schemas"]["CampaignSendPlan"];
|
|
237610
237798
|
};
|
|
237799
|
+
CampaignHeaderMediaMeta: {
|
|
237800
|
+
/** @description Recipients still `pending` whose frozen params now carry the new link. Already sent / delivered / read / failed ones are history and keep theirs. */
|
|
237801
|
+
updated_recipients: number;
|
|
237802
|
+
};
|
|
237803
|
+
CampaignHeaderMediaBody: {
|
|
237804
|
+
/**
|
|
237805
|
+
* @description Public https link to the image / video / PDF (e.g. the `url` `POST /whatsapp-templates/header-media` returns).
|
|
237806
|
+
* @example https://media.example.com/promo-noviembre.jpg
|
|
237807
|
+
*/
|
|
237808
|
+
url: string;
|
|
237809
|
+
};
|
|
237611
237810
|
CampaignSendNowResult: {
|
|
237612
237811
|
/** @enum {boolean} */
|
|
237613
237812
|
started: true;
|
package/package.json
CHANGED