@getlatedev/node 0.2.396 → 0.2.397

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.
@@ -2535,7 +2535,13 @@ export type InboxWebhookMessage = {
2535
2535
  */
2536
2536
  type: string;
2537
2537
  /**
2538
- * Attachment URL (may expire for Meta platforms)
2538
+ * Where to fetch the attachment. The contract depends on direction and
2539
+ * platform: inbound WhatsApp media points at the authenticated
2540
+ * `GET /v1/whatsapp/media/{mediaId}` and requires
2541
+ * `Authorization: Bearer <your API key>`, while outgoing media carries the
2542
+ * URL originally supplied and Instagram / Facebook / Telegram carry direct
2543
+ * platform CDN links that need no authentication.
2544
+ *
2539
2545
  */
2540
2546
  url: string;
2541
2547
  /**
@@ -5763,7 +5769,19 @@ export type WebhookPayloadMessage = {
5763
5769
  */
5764
5770
  type: string;
5765
5771
  /**
5766
- * Attachment URL (may expire for Meta platforms)
5772
+ * Where to fetch the attachment. **The contract differs by platform.**
5773
+ *
5774
+ * - **WhatsApp**: points at `GET /v1/whatsapp/media/{mediaId}`, an
5775
+ * authenticated Zernio endpoint. You MUST send
5776
+ * `Authorization: Bearer <your API key>`; fetching it without that
5777
+ * header returns `401`. Download and store the bytes when this
5778
+ * webhook arrives: Meta drops inbound media after a limited
5779
+ * retention window, after which the endpoint answers `400`
5780
+ * permanently and the media is unrecoverable.
5781
+ * - **Instagram / Facebook / Telegram**: a direct platform CDN link
5782
+ * that needs no authentication and expires on the platform's own
5783
+ * schedule.
5784
+ *
5767
5785
  */
5768
5786
  url: string;
5769
5787
  /**
@@ -6194,7 +6212,13 @@ export type WebhookPayloadMessageSent = {
6194
6212
  */
6195
6213
  type: string;
6196
6214
  /**
6197
- * Attachment URL (may expire for Meta platforms)
6215
+ * Where to fetch the attachment. For outgoing messages this is the
6216
+ * media URL as sent, so for WhatsApp it is the URL you supplied when
6217
+ * publishing (WhatsApp sends media by link), not a Zernio endpoint,
6218
+ * and it needs no Zernio credentials. Contrast the inbound direction:
6219
+ * `message.received` attachment URLs on WhatsApp point at the
6220
+ * authenticated `GET /v1/whatsapp/media/{mediaId}`.
6221
+ *
6198
6222
  */
6199
6223
  url: string;
6200
6224
  /**
@@ -7649,7 +7673,7 @@ export type GetInstagramAccountInsightsData = {
7649
7673
 
7650
7674
  export type GetInstagramAccountInsightsResponse = (InstagramAccountInsightsResponse);
7651
7675
 
7652
- export type GetInstagramAccountInsightsError = (ErrorResponse | {
7676
+ export type GetInstagramAccountInsightsError = ({
7653
7677
  error?: string;
7654
7678
  } | {
7655
7679
  error?: string;
@@ -8648,7 +8672,7 @@ export type GetMediaPresignedUrlResponse = ({
8648
8672
  expiresIn?: number;
8649
8673
  });
8650
8674
 
8651
- export type GetMediaPresignedUrlError = ({
8675
+ export type GetMediaPresignedUrlError = (ErrorResponse | {
8652
8676
  error?: string;
8653
8677
  });
8654
8678
 
@@ -15573,6 +15597,27 @@ export type SendInboxMessageError = ({
15573
15597
  error?: string;
15574
15598
  } | unknown);
15575
15599
 
15600
+ export type GetWhatsAppMediaData = {
15601
+ path: {
15602
+ /**
15603
+ * The media id from `attachments[].payload.id`.
15604
+ */
15605
+ mediaId: string;
15606
+ };
15607
+ query: {
15608
+ /**
15609
+ * The WhatsApp account that received the media.
15610
+ */
15611
+ accountId: string;
15612
+ };
15613
+ };
15614
+
15615
+ export type GetWhatsAppMediaResponse = ((Blob | File));
15616
+
15617
+ export type GetWhatsAppMediaError = (unknown | {
15618
+ error?: string;
15619
+ });
15620
+
15576
15621
  export type EditInboxMessageData = {
15577
15622
  body: {
15578
15623
  /**
@@ -17818,7 +17863,7 @@ export type DialVoiceWebCallError = ({
17818
17863
  export type SendSmsData = {
17819
17864
  body: {
17820
17865
  /**
17821
- * One of your SMS-enabled numbers (E.164; formatting is normalized), or an approved alphanumeric sender ID (3-11 letters/digits/spaces, created via `/v1/sms/sender-ids`).
17866
+ * One of your SMS-enabled numbers (E.164; formatting is normalized).
17822
17867
  */
17823
17868
  from: string;
17824
17869
  /**
@@ -17858,7 +17903,7 @@ export type SendSmsResponse = ({
17858
17903
  status?: 'sent';
17859
17904
  });
17860
17905
 
17861
- export type SendSmsError = (ErrorResponse | {
17906
+ export type SendSmsError = ({
17862
17907
  error?: string;
17863
17908
  } | unknown);
17864
17909
 
@@ -17912,105 +17957,6 @@ export type ListSmsOptOutsError = ({
17912
17957
  error?: string;
17913
17958
  });
17914
17959
 
17915
- export type CreateSmsSenderIdData = {
17916
- body: {
17917
- /**
17918
- * The sender ID recipients will see (3-11 letters/digits/spaces, at least one letter, no leading/trailing space).
17919
- */
17920
- senderId: string;
17921
- };
17922
- };
17923
-
17924
- export type CreateSmsSenderIdResponse = ({
17925
- /**
17926
- * Sender ID resource id.
17927
- */
17928
- id?: string;
17929
- senderId?: string;
17930
- isActive?: boolean;
17931
- });
17932
-
17933
- export type CreateSmsSenderIdError = (ErrorResponse | {
17934
- error?: string;
17935
- } | unknown);
17936
-
17937
- export type ListSmsSenderIdsResponse = ({
17938
- senderIds?: Array<{
17939
- id?: string;
17940
- senderId?: string;
17941
- isActive?: boolean;
17942
- createdAt?: (string) | null;
17943
- }>;
17944
- /**
17945
- * Workspace-wide daily sending budget, shared by every sender ID (resets midnight UTC).
17946
- */
17947
- budget?: {
17948
- /**
17949
- * Daily message cap (raisable via `/v1/sms/sender-ids/limit-request`).
17950
- */
17951
- cap?: number;
17952
- /**
17953
- * Messages already counted against today's cap.
17954
- */
17955
- usedToday?: number;
17956
- /**
17957
- * Cap tier (Level 1 = 500/day).
17958
- */
17959
- level?: number;
17960
- /**
17961
- * The in-flight cap-raise request awaiting review, or null. While set, further requests return 409.
17962
- */
17963
- pendingRequest?: {
17964
- requestedCap?: number;
17965
- level?: number;
17966
- requestedAt?: (string) | null;
17967
- } | null;
17968
- };
17969
- });
17970
-
17971
- export type ListSmsSenderIdsError = ({
17972
- error?: string;
17973
- });
17974
-
17975
- export type RequestSmsSenderIdLimitIncreaseData = {
17976
- body: {
17977
- /**
17978
- * Desired daily message cap. Must exceed the current cap.
17979
- */
17980
- requestedCap: number;
17981
- /**
17982
- * Use case and audience (what you send, to whom, opt-in status).
17983
- */
17984
- reason: string;
17985
- };
17986
- };
17987
-
17988
- export type RequestSmsSenderIdLimitIncreaseResponse = ({
17989
- requested?: boolean;
17990
- requestedCap?: number;
17991
- });
17992
-
17993
- export type RequestSmsSenderIdLimitIncreaseError = (ErrorResponse | {
17994
- error?: string;
17995
- } | unknown);
17996
-
17997
- export type DeleteSmsSenderIdData = {
17998
- path: {
17999
- /**
18000
- * Sender ID resource id.
18001
- */
18002
- id: string;
18003
- };
18004
- };
18005
-
18006
- export type DeleteSmsSenderIdResponse = ({
18007
- deleted?: boolean;
18008
- });
18009
-
18010
- export type DeleteSmsSenderIdError = (ErrorResponse | {
18011
- error?: string;
18012
- } | unknown);
18013
-
18014
17960
  export type StartSmsRegistrationData = {
18015
17961
  body: {
18016
17962
  registrationType: 'standard_10dlc' | 'sole_prop_10dlc' | 'toll_free';
@@ -23785,48 +23731,6 @@ export type ListAdCampaignsError = ({
23785
23731
  error?: string;
23786
23732
  } | unknown);
23787
23733
 
23788
- export type CreateAdCampaignData = {
23789
- body: {
23790
- /**
23791
- * Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
23792
- */
23793
- accountId: string;
23794
- /**
23795
- * Meta ad account id (act_<n>).
23796
- */
23797
- adAccountId: string;
23798
- name: string;
23799
- /**
23800
- * Mapped to the ODAX objective (same mapping as POST /v1/ads/create).
23801
- */
23802
- goal: 'engagement' | 'traffic' | 'awareness' | 'video_views' | 'lead_generation' | 'lead_conversion' | 'job_applicants' | 'conversions' | 'app_promotion' | 'catalog_sales';
23803
- specialAdCategories?: Array<('HOUSING' | 'EMPLOYMENT' | 'CREDIT' | 'ISSUES_ELECTIONS_POLITICS' | 'FINANCIAL_PRODUCTS_SERVICES' | 'ONLINE_GAMBLING_AND_GAMING')>;
23804
- /**
23805
- * Campaign-level (CBO) budget in whole currency units. Requires budgetType.
23806
- */
23807
- budgetAmount?: number;
23808
- budgetType?: 'daily' | 'lifetime';
23809
- status?: 'ACTIVE' | 'PAUSED';
23810
- };
23811
- };
23812
-
23813
- export type CreateAdCampaignResponse = ({
23814
- adAccountId?: string;
23815
- /**
23816
- * Platform id of the new campaign
23817
- */
23818
- campaignId?: string;
23819
- /**
23820
- * Resolved ODAX objective (e.g. OUTCOME_SALES).
23821
- */
23822
- objective?: string;
23823
- status?: 'ACTIVE' | 'PAUSED';
23824
- });
23825
-
23826
- export type CreateAdCampaignError = (unknown | {
23827
- error?: string;
23828
- });
23829
-
23830
23734
  export type UpdateAdCampaignStatusData = {
23831
23735
  body: {
23832
23736
  status: 'active' | 'paused';
@@ -24018,89 +23922,6 @@ export type DuplicateAdCampaignError = (unknown | {
24018
23922
  error?: string;
24019
23923
  });
24020
23924
 
24021
- export type DuplicateAdSetData = {
24022
- body: {
24023
- platform: 'facebook' | 'instagram';
24024
- /**
24025
- * Destination platform campaign id (defaults to the source's campaign)
24026
- */
24027
- campaignId?: string;
24028
- /**
24029
- * Copy child ads + creatives
24030
- */
24031
- deepCopy?: boolean;
24032
- statusOption?: 'ACTIVE' | 'PAUSED' | 'INHERITED_FROM_SOURCE';
24033
- /**
24034
- * Reschedule the copy's start time
24035
- */
24036
- startTime?: string;
24037
- endTime?: string;
24038
- renameStrategy?: 'DEEP_RENAME' | 'ONLY_TOP_LEVEL_RENAME' | 'NO_RENAME';
24039
- renamePrefix?: string;
24040
- renameSuffix?: string;
24041
- syncAfter?: boolean;
24042
- };
24043
- path: {
24044
- /**
24045
- * Source platform ad set ID
24046
- */
24047
- adSetId: string;
24048
- };
24049
- };
24050
-
24051
- export type DuplicateAdSetResponse = ({
24052
- /**
24053
- * Platform ID of the new ad set
24054
- */
24055
- copiedAdSetId?: string;
24056
- discovery?: 'triggered' | 'skipped' | 'failed';
24057
- /**
24058
- * Meta's native copy response (includes ad_object_ids for child copies)
24059
- */
24060
- raw?: {
24061
- [key: string]: unknown;
24062
- };
24063
- });
24064
-
24065
- export type DuplicateAdSetError = (unknown | {
24066
- error?: string;
24067
- });
24068
-
24069
- export type DuplicateAdData = {
24070
- body?: {
24071
- /**
24072
- * Destination platform ad set id (defaults to the source's ad set)
24073
- */
24074
- adSetId?: string;
24075
- statusOption?: 'ACTIVE' | 'PAUSED' | 'INHERITED_FROM_SOURCE';
24076
- renameStrategy?: 'DEEP_RENAME' | 'ONLY_TOP_LEVEL_RENAME' | 'NO_RENAME';
24077
- renamePrefix?: string;
24078
- renameSuffix?: string;
24079
- syncAfter?: boolean;
24080
- };
24081
- path: {
24082
- /**
24083
- * Zernio ad ID or platform ad ID
24084
- */
24085
- adId: string;
24086
- };
24087
- };
24088
-
24089
- export type DuplicateAdResponse = ({
24090
- /**
24091
- * Platform ID of the new ad
24092
- */
24093
- copiedAdId?: string;
24094
- discovery?: 'triggered' | 'skipped' | 'failed';
24095
- raw?: {
24096
- [key: string]: unknown;
24097
- };
24098
- });
24099
-
24100
- export type DuplicateAdError = (unknown | {
24101
- error?: string;
24102
- });
24103
-
24104
23925
  export type GetAdSetDetailsData = {
24105
23926
  path: {
24106
23927
  /**
@@ -25332,271 +25153,6 @@ export type ListAdStudiesError = (unknown | {
25332
25153
  error?: string;
25333
25154
  });
25334
25155
 
25335
- export type ListAdLabelsData = {
25336
- query: {
25337
- /**
25338
- * Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
25339
- */
25340
- accountId: string;
25341
- /**
25342
- * Meta ad account id (act_<n>).
25343
- */
25344
- adAccountId: string;
25345
- /**
25346
- * Cursor from paging.after of the previous page.
25347
- */
25348
- after?: string;
25349
- /**
25350
- * Rows per page
25351
- */
25352
- limit?: number;
25353
- };
25354
- };
25355
-
25356
- export type ListAdLabelsResponse = ({
25357
- adAccountId?: string;
25358
- data?: Array<{
25359
- [key: string]: unknown;
25360
- }>;
25361
- paging?: {
25362
- /**
25363
- * Cursor for the next page; null when exhausted.
25364
- */
25365
- after?: (string) | null;
25366
- };
25367
- });
25368
-
25369
- export type ListAdLabelsError = (unknown | {
25370
- error?: string;
25371
- });
25372
-
25373
- export type ListHighDemandPeriodsData = {
25374
- query: {
25375
- /**
25376
- * Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
25377
- */
25378
- accountId: string;
25379
- /**
25380
- * Platform ad set id. Exactly one of campaignId / adSetId.
25381
- */
25382
- adSetId?: string;
25383
- /**
25384
- * Cursor from paging.after of the previous page.
25385
- */
25386
- after?: string;
25387
- /**
25388
- * Platform campaign id. Exactly one of campaignId / adSetId.
25389
- */
25390
- campaignId?: string;
25391
- /**
25392
- * Rows per page
25393
- */
25394
- limit?: number;
25395
- };
25396
- };
25397
-
25398
- export type ListHighDemandPeriodsResponse = ({
25399
- /**
25400
- * The campaign / ad set id the schedules belong to.
25401
- */
25402
- objectId?: string;
25403
- data?: Array<{
25404
- [key: string]: unknown;
25405
- }>;
25406
- paging?: {
25407
- /**
25408
- * Cursor for the next page; null when exhausted.
25409
- */
25410
- after?: (string) | null;
25411
- };
25412
- });
25413
-
25414
- export type ListHighDemandPeriodsError = (unknown | {
25415
- error?: string;
25416
- });
25417
-
25418
- export type ListAdCreativesData = {
25419
- query: {
25420
- /**
25421
- * Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
25422
- */
25423
- accountId: string;
25424
- /**
25425
- * Meta ad account id (act_<n>).
25426
- */
25427
- adAccountId: string;
25428
- /**
25429
- * Cursor from paging.after of the previous page.
25430
- */
25431
- after?: string;
25432
- /**
25433
- * Comma-separated Graph field override (supports nested {} projections).
25434
- */
25435
- fields?: string;
25436
- /**
25437
- * Rows per page
25438
- */
25439
- limit?: number;
25440
- };
25441
- };
25442
-
25443
- export type ListAdCreativesResponse = ({
25444
- adAccountId?: string;
25445
- data?: Array<{
25446
- [key: string]: unknown;
25447
- }>;
25448
- paging?: {
25449
- /**
25450
- * Cursor for the next page; null when exhausted.
25451
- */
25452
- after?: (string) | null;
25453
- };
25454
- });
25455
-
25456
- export type ListAdCreativesError = (unknown | {
25457
- error?: string;
25458
- });
25459
-
25460
- export type CreateAdCreativeData = {
25461
- body: {
25462
- /**
25463
- * Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token and Page.
25464
- */
25465
- accountId: string;
25466
- /**
25467
- * Meta ad account id (act_<n>).
25468
- */
25469
- adAccountId: string;
25470
- headline: string;
25471
- /**
25472
- * Primary text
25473
- */
25474
- body: string;
25475
- /**
25476
- * Link description below the headline; omitted = Meta scrapes the destination's OG description.
25477
- */
25478
- description?: string;
25479
- /**
25480
- * CTA type (same whitelist as POST /v1/ads/create).
25481
- */
25482
- callToAction?: string;
25483
- linkUrl: string;
25484
- /**
25485
- * Publicly reachable image; uploaded to the account's library server-side.
25486
- */
25487
- imageUrl?: string;
25488
- /**
25489
- * Existing library image hash (POST /v1/ads/images or GET /v1/ads/images).
25490
- */
25491
- imageHash?: string;
25492
- carouselCards?: Array<{
25493
- imageUrl: string;
25494
- linkUrl: string;
25495
- headline?: string;
25496
- description?: string;
25497
- callToAction?: string;
25498
- }>;
25499
- /**
25500
- * Appended to every outbound URL (e.g. utm_source=fb).
25501
- */
25502
- urlTags?: string;
25503
- };
25504
- };
25505
-
25506
- export type CreateAdCreativeResponse = ({
25507
- adAccountId?: string;
25508
- /**
25509
- * Platform creative id, reusable via existingCreativeId.
25510
- */
25511
- creativeId?: string;
25512
- });
25513
-
25514
- export type CreateAdCreativeError = (unknown | {
25515
- error?: string;
25516
- });
25517
-
25518
- export type GetAdCreativeData = {
25519
- path: {
25520
- /**
25521
- * Platform creative id
25522
- */
25523
- creativeId: string;
25524
- };
25525
- query: {
25526
- /**
25527
- * Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
25528
- */
25529
- accountId: string;
25530
- /**
25531
- * Comma-separated Graph field override (supports nested {} projections).
25532
- */
25533
- fields?: string;
25534
- };
25535
- };
25536
-
25537
- export type GetAdCreativeResponse = ({
25538
- /**
25539
- * Raw Meta creative node
25540
- */
25541
- creative?: {
25542
- [key: string]: unknown;
25543
- };
25544
- });
25545
-
25546
- export type GetAdCreativeError = (unknown | {
25547
- error?: string;
25548
- });
25549
-
25550
- export type UpdateAdCreativeData = {
25551
- body: {
25552
- /**
25553
- * Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
25554
- */
25555
- accountId: string;
25556
- name: string;
25557
- };
25558
- path: {
25559
- /**
25560
- * Platform creative id
25561
- */
25562
- creativeId: string;
25563
- };
25564
- };
25565
-
25566
- export type UpdateAdCreativeResponse = ({
25567
- creativeId?: string;
25568
- name?: string;
25569
- message?: string;
25570
- });
25571
-
25572
- export type UpdateAdCreativeError = (unknown | {
25573
- error?: string;
25574
- });
25575
-
25576
- export type DeleteAdCreativeData = {
25577
- path: {
25578
- /**
25579
- * Platform creative id
25580
- */
25581
- creativeId: string;
25582
- };
25583
- query: {
25584
- /**
25585
- * Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
25586
- */
25587
- accountId: string;
25588
- };
25589
- };
25590
-
25591
- export type DeleteAdCreativeResponse = ({
25592
- creativeId?: string;
25593
- message?: string;
25594
- });
25595
-
25596
- export type DeleteAdCreativeError = (unknown | {
25597
- error?: string;
25598
- });
25599
-
25600
25156
  export type GetAdAccountFinanceData = {
25601
25157
  query: {
25602
25158
  /**
@@ -27077,48 +26633,6 @@ export type UploadAdImageError = (unknown | {
27077
26633
  error?: string;
27078
26634
  });
27079
26635
 
27080
- export type ListAdImagesData = {
27081
- query: {
27082
- /**
27083
- * Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
27084
- */
27085
- accountId: string;
27086
- /**
27087
- * Meta ad account id (act_<n>).
27088
- */
27089
- adAccountId: string;
27090
- /**
27091
- * Cursor from paging.after of the previous page.
27092
- */
27093
- after?: string;
27094
- /**
27095
- * Comma-separated Graph field override (supports nested {} projections).
27096
- */
27097
- fields?: string;
27098
- /**
27099
- * Rows per page
27100
- */
27101
- limit?: number;
27102
- };
27103
- };
27104
-
27105
- export type ListAdImagesResponse = ({
27106
- adAccountId?: string;
27107
- data?: Array<{
27108
- [key: string]: unknown;
27109
- }>;
27110
- paging?: {
27111
- /**
27112
- * Cursor for the next page; null when exhausted.
27113
- */
27114
- after?: (string) | null;
27115
- };
27116
- });
27117
-
27118
- export type ListAdImagesError = (unknown | {
27119
- error?: string;
27120
- });
27121
-
27122
26636
  export type SearchAdInterestsData = {
27123
26637
  query: {
27124
26638
  /**