@getlatedev/node 0.2.1348 → 0.2.1350
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/README.md +2 -0
- package/dist/index.d.mts +136 -8
- package/dist/index.d.ts +136 -8
- package/dist/index.js +19 -1
- package/dist/index.mjs +19 -1
- package/package.json +1 -1
- package/src/client.ts +8 -0
- package/src/generated/sdk.gen.ts +37 -2
- package/src/generated/types.gen.ts +137 -7
|
@@ -659,6 +659,37 @@ export type AdAnalyticsResponse = {
|
|
|
659
659
|
};
|
|
660
660
|
};
|
|
661
661
|
|
|
662
|
+
/**
|
|
663
|
+
* What the create filled in for fields the request left out. Empty when every field was sent. A passing validateOnly returns it too, so a dry run previews these values before anything is created.
|
|
664
|
+
*/
|
|
665
|
+
export type AdAppliedDefaults = {
|
|
666
|
+
/**
|
|
667
|
+
* Sent when `name` was omitted: `Ad <YYYY-MM-DD HH:MM:SS>` in UTC.
|
|
668
|
+
*/
|
|
669
|
+
name?: string;
|
|
670
|
+
/**
|
|
671
|
+
* Sent when `goal` was omitted. `lead_generation` with a `leadGenFormId`; `app_promotion` when `promotedObject` names an app; `conversions` with `promotedObject.pixelId` and `customEventType`; `traffic` when the ad has a link (`linkUrl`, a carousel card, `creatives[].linkUrl`, `dynamicCreative.linkUrls` or a LinkedIn carousel card); otherwise `engagement`. Each only when the platform offers it, falling back to `engagement`, then `awareness`, then the platform's first goal. Never inferred with `existingCampaignId`, `smartPlus` or the LinkedIn spotlight, follower and jobs formats: those still return 400 without `goal`.
|
|
672
|
+
*/
|
|
673
|
+
goal?: string;
|
|
674
|
+
/**
|
|
675
|
+
* Sent when `budgetAmount` came without `budgetType`.
|
|
676
|
+
*/
|
|
677
|
+
budgetType?: 'daily';
|
|
678
|
+
/**
|
|
679
|
+
* Sent when a lifetime budget had no `endDate`: 7 days after the start. A start with an offset (or no start) gets a UTC instant; an offset-less start gets an offset-less end, read in the ad account timezone like the start; a date-only start gets the date 6 days later, which runs to 23:59:59. A daily budget never gets one and runs until paused.
|
|
680
|
+
*/
|
|
681
|
+
endDate?: string;
|
|
682
|
+
/**
|
|
683
|
+
* Sent when the request sent no countries and the ad gets the long-standing United States default. Not sent on attach, Google Performance Max or Demand Gen, or a Google ad group joining `existingCampaignId`, which keep their own geo.
|
|
684
|
+
*/
|
|
685
|
+
countries?: Array<(string)>;
|
|
686
|
+
};
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* Sent when `budgetAmount` came without `budgetType`.
|
|
690
|
+
*/
|
|
691
|
+
export type budgetType = 'daily';
|
|
692
|
+
|
|
662
693
|
/**
|
|
663
694
|
* Budget amount in the ad account's native currency (see the campaign's `currency` field for the code).
|
|
664
695
|
*/
|
|
@@ -1121,6 +1152,14 @@ export type AdLead = {
|
|
|
1121
1152
|
* When the first WhatsApp message to the lead was delivered.
|
|
1122
1153
|
*/
|
|
1123
1154
|
firstContactedAt?: (string) | null;
|
|
1155
|
+
/**
|
|
1156
|
+
* The Inbox conversation a lead_received workflow opened with the lead.
|
|
1157
|
+
*/
|
|
1158
|
+
conversationId?: (string) | null;
|
|
1159
|
+
/**
|
|
1160
|
+
* Meta leads only. When the `lead.received` webhook was delivered; null while it has not been.
|
|
1161
|
+
*/
|
|
1162
|
+
webhookDeliveredAt?: (string) | null;
|
|
1124
1163
|
};
|
|
1125
1164
|
|
|
1126
1165
|
/**
|
|
@@ -6098,7 +6137,7 @@ export type CtwaAdRequestBody = {
|
|
|
6098
6137
|
/**
|
|
6099
6138
|
* Required unless `adSetId` is set or `existingCampaignId` names a campaign with a campaign budget. `lifetime` requires `endDate`.
|
|
6100
6139
|
*/
|
|
6101
|
-
export type
|
|
6140
|
+
export type budgetType2 = 'daily' | 'lifetime';
|
|
6102
6141
|
|
|
6103
6142
|
/**
|
|
6104
6143
|
* Restrict the audience by gender (Meta `genders`). Omit or send all for everyone; all is ignored in adSetId attach mode. Stored on the ad and read back in `targeting.gender`.
|
|
@@ -6604,6 +6643,12 @@ export type ErrorResponse = {
|
|
|
6604
6643
|
[key: string]: unknown;
|
|
6605
6644
|
};
|
|
6606
6645
|
/**
|
|
6646
|
+
* Meta ads refusals customers hit most come back with their own `code` instead of
|
|
6647
|
+
* `platform_api_error`, the field to fix in `param`, and `details.fix` ({ label, url }) pointing at
|
|
6648
|
+
* the Meta page that resolves it: `ad_account_payment_required`, `ad_account_policy_not_accepted`,
|
|
6649
|
+
* `meta_security_check_required`, `meta_action_blocked`,
|
|
6650
|
+
* `whatsapp_number_not_linked` and `invalid_targeting`. Meta's own error stays in the message
|
|
6651
|
+
* and in `platformError`.
|
|
6607
6652
|
* Additional structured context (e.g. field-level validation errors), for example
|
|
6608
6653
|
* `privateReplyConsumed` on the private-reply endpoint's 400 when the comment's
|
|
6609
6654
|
* single reply is already spent, and `privateReplyOutcome: "unknown"` on its 502 when Meta
|
|
@@ -47279,7 +47324,7 @@ export type GenerateAdPreviewsData = {
|
|
|
47279
47324
|
*/
|
|
47280
47325
|
existingCreativeId?: string;
|
|
47281
47326
|
/**
|
|
47282
|
-
* Raw Meta creative spec forwarded
|
|
47327
|
+
* Raw Meta creative spec forwarded to /generatepreviews. Mutually exclusive with existingCreativeId. An `object_story_spec` without `page_id` or `instagram_user_id`, and a `source_instagram_media_id` spec without `instagram_user_id`, get the connection's Facebook Page and Instagram account, as a create would.
|
|
47283
47328
|
*/
|
|
47284
47329
|
creativeSpec?: {
|
|
47285
47330
|
[key: string]: unknown;
|
|
@@ -50904,6 +50949,37 @@ export type GetAdAccountFinanceResponse = ({
|
|
|
50904
50949
|
|
|
50905
50950
|
export type GetAdAccountFinanceError = (unknown | ErrorResponse);
|
|
50906
50951
|
|
|
50952
|
+
export type GetAdAccountHealthData = {
|
|
50953
|
+
query: {
|
|
50954
|
+
/**
|
|
50955
|
+
* Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
|
|
50956
|
+
*/
|
|
50957
|
+
accountId: string;
|
|
50958
|
+
/**
|
|
50959
|
+
* Meta ad account id (act_<n>).
|
|
50960
|
+
*/
|
|
50961
|
+
adAccountId: string;
|
|
50962
|
+
};
|
|
50963
|
+
};
|
|
50964
|
+
|
|
50965
|
+
export type GetAdAccountHealthResponse = ({
|
|
50966
|
+
adAccountId?: string;
|
|
50967
|
+
status?: 'ok' | 'attention' | 'blocked';
|
|
50968
|
+
checkedAt?: string;
|
|
50969
|
+
checks?: Array<{
|
|
50970
|
+
id: 'account_status' | 'payment' | 'spend_cap' | 'page' | 'instagram' | 'lead_terms' | 'pixel' | 'whatsapp';
|
|
50971
|
+
status: 'ok' | 'warning' | 'error' | 'missing' | 'unknown';
|
|
50972
|
+
title: string;
|
|
50973
|
+
message: string;
|
|
50974
|
+
fix?: {
|
|
50975
|
+
label?: string;
|
|
50976
|
+
url?: string;
|
|
50977
|
+
};
|
|
50978
|
+
}>;
|
|
50979
|
+
});
|
|
50980
|
+
|
|
50981
|
+
export type GetAdAccountHealthError = (ErrorResponse | unknown);
|
|
50982
|
+
|
|
50907
50983
|
export type GetAdAccountLiveEntitiesData = {
|
|
50908
50984
|
query: {
|
|
50909
50985
|
/**
|
|
@@ -52236,7 +52312,10 @@ export type CreateStandaloneAdData = {
|
|
|
52236
52312
|
body: {
|
|
52237
52313
|
accountId: string;
|
|
52238
52314
|
adAccountId: string;
|
|
52239
|
-
|
|
52315
|
+
/**
|
|
52316
|
+
* Omitted, the ad is named `Ad <YYYY-MM-DD HH:MM:SS>` (UTC) and the response reports it in `appliedDefaults.name`.
|
|
52317
|
+
*/
|
|
52318
|
+
name?: string;
|
|
52240
52319
|
/**
|
|
52241
52320
|
* Meta, Reddit and Google. Exact campaign name. Overrides the default `<name> - Campaign`. Ignored when the request joins an existing campaign or ad set. Google: no line breaks and at most 255 characters, checked before calling Google; names are unique in the Google Ads account, and on Search and Display a taken name is a 400 naming this field.
|
|
52242
52321
|
*/
|
|
@@ -52251,7 +52330,7 @@ export type CreateStandaloneAdData = {
|
|
|
52251
52330
|
adName?: string;
|
|
52252
52331
|
tracking?: AdTracking;
|
|
52253
52332
|
/**
|
|
52254
|
-
*
|
|
52333
|
+
* Available goals vary by platform. Omitted, it is inferred from the ad (see `appliedDefaults.goal` in the response); the attach shape inherits it from the ad set.
|
|
52255
52334
|
*
|
|
52256
52335
|
* **Meta**
|
|
52257
52336
|
* - `conversions`: OUTCOME_SALES. Requires `promotedObject.pixelId` and `promotedObject.customEventType` with a commerce event such as PURCHASE or START_TRIAL, or `promotedObject.customConversionId` to optimise against a Custom Conversion, or `customEventType: OTHER` + `customEventStr` to optimise against a pixel custom event.
|
|
@@ -52348,7 +52427,7 @@ export type CreateStandaloneAdData = {
|
|
|
52348
52427
|
*/
|
|
52349
52428
|
budgetAmount?: number;
|
|
52350
52429
|
/**
|
|
52351
|
-
*
|
|
52430
|
+
* Defaults to daily when `budgetAmount` is sent without it (reported in `appliedDefaults.budgetType`). Inherited on attach. OpenAI Ads accepts both as the campaign's single spend cap. A lifetime cap can later switch to daily with PUT /v1/ads/campaigns/{campaignId}, but OpenAI never switches a daily cap back to lifetime (422). Automatic bidding (Maximize Results) needs a daily budget. Reddit Ads: the ad group's daily or lifetime spend goal.
|
|
52352
52431
|
*/
|
|
52353
52432
|
budgetType?: 'daily' | 'lifetime';
|
|
52354
52433
|
/**
|
|
@@ -52875,7 +52954,7 @@ export type CreateStandaloneAdData = {
|
|
|
52875
52954
|
[key: string]: (string | number);
|
|
52876
52955
|
};
|
|
52877
52956
|
/**
|
|
52878
|
-
*
|
|
52957
|
+
* Omitted on a lifetime budget, the ad ends 7 days after it starts (reported in `appliedDefaults.endDate`); a daily budget without one runs until paused. Read like `startDate` (account timezone on Meta, TikTok, X, Pinterest, OpenAI and Reddit; whole account-local days on Google; UTC on LinkedIn), and a date-only end runs to 23:59:59 local.
|
|
52879
52958
|
*/
|
|
52880
52959
|
endDate?: string;
|
|
52881
52960
|
/**
|
|
@@ -53403,7 +53482,7 @@ export type CreateStandaloneAdData = {
|
|
|
53403
53482
|
* Targeting works like on any TikTok ad (defaults to `countries: ["US"]` when
|
|
53404
53483
|
* omitted); TikTok automates delivery within it.
|
|
53405
53484
|
* The budget lives on the Smart+ campaign (Campaign Budget Optimization); a `lifetime`
|
|
53406
|
-
* budget
|
|
53485
|
+
* budget without `endDate` ends 7 days after it starts. Smart+ needs `goal` sent, it is never inferred. Cannot be combined with `adSetId`.
|
|
53407
53486
|
*
|
|
53408
53487
|
*/
|
|
53409
53488
|
smartPlus?: boolean;
|
|
@@ -53438,6 +53517,7 @@ export type CreateStandaloneAdResponse = ({
|
|
|
53438
53517
|
* Always true in a validate-only response.
|
|
53439
53518
|
*/
|
|
53440
53519
|
validateOnly?: boolean;
|
|
53520
|
+
appliedDefaults?: AdAppliedDefaults;
|
|
53441
53521
|
results?: Array<{
|
|
53442
53522
|
node?: 'campaign' | 'adSet' | 'creative' | 'ad' | 'performanceMaxCampaign';
|
|
53443
53523
|
status?: 'validated' | 'skipped' | 'unverified';
|
|
@@ -53449,11 +53529,13 @@ export type CreateStandaloneAdResponse = ({
|
|
|
53449
53529
|
message?: string;
|
|
53450
53530
|
} | ({
|
|
53451
53531
|
ad?: Ad;
|
|
53532
|
+
appliedDefaults?: AdAppliedDefaults;
|
|
53452
53533
|
message?: string;
|
|
53453
53534
|
} | {
|
|
53454
53535
|
ads?: Array<Ad>;
|
|
53455
53536
|
platformCampaignId?: string;
|
|
53456
53537
|
platformAdSetId?: string;
|
|
53538
|
+
appliedDefaults?: AdAppliedDefaults;
|
|
53457
53539
|
message?: string;
|
|
53458
53540
|
}));
|
|
53459
53541
|
|
|
@@ -53465,10 +53547,18 @@ export type ListLeadsData = {
|
|
|
53465
53547
|
* Filter to a single connected account. LinkedIn ads accounts switch to the live fetch.
|
|
53466
53548
|
*/
|
|
53467
53549
|
accountId?: string;
|
|
53550
|
+
/**
|
|
53551
|
+
* Meta only. Comma-separated connected account ids, to list several accounts at once. Without accountId or accountIds every account of the team is listed.
|
|
53552
|
+
*/
|
|
53553
|
+
accountIds?: string;
|
|
53468
53554
|
/**
|
|
53469
53555
|
* LinkedIn only: the LinkedIn ad account id whose responses to read (owner-scoped finder).
|
|
53470
53556
|
*/
|
|
53471
53557
|
adAccountId?: string;
|
|
53558
|
+
/**
|
|
53559
|
+
* Meta only. The platform campaign id the lead came from.
|
|
53560
|
+
*/
|
|
53561
|
+
campaignId?: string;
|
|
53472
53562
|
/**
|
|
53473
53563
|
* Keyset cursor from a previous response's pagination.cursor (Meta: AdLead id; LinkedIn: numeric start offset).
|
|
53474
53564
|
*/
|
|
@@ -53478,10 +53568,22 @@ export type ListLeadsData = {
|
|
|
53478
53568
|
*/
|
|
53479
53569
|
formId?: string;
|
|
53480
53570
|
limit?: number;
|
|
53571
|
+
/**
|
|
53572
|
+
* meta skips the LinkedIn live fetch; linkedin requires accountId to be a LinkedIn ads connection (400 otherwise).
|
|
53573
|
+
*/
|
|
53574
|
+
platform?: 'meta' | 'linkedin';
|
|
53575
|
+
/**
|
|
53576
|
+
* Meta only. Case-insensitive text search over the lead's answers and the form name.
|
|
53577
|
+
*/
|
|
53578
|
+
q?: string;
|
|
53481
53579
|
/**
|
|
53482
53580
|
* Unix seconds; only leads created at/after this timestamp. Millisecond timestamps return 400 with instructions to divide by 1000.
|
|
53483
53581
|
*/
|
|
53484
53582
|
since?: number;
|
|
53583
|
+
/**
|
|
53584
|
+
* Meta only. Comma-separated lead statuses: new, contacted, unreachable, qualified, converted, disqualified.
|
|
53585
|
+
*/
|
|
53586
|
+
status?: string;
|
|
53485
53587
|
};
|
|
53486
53588
|
};
|
|
53487
53589
|
|
|
@@ -53503,6 +53605,34 @@ export type ListLeadsResponse = ({
|
|
|
53503
53605
|
|
|
53504
53606
|
export type ListLeadsError = (ErrorResponse | unknown);
|
|
53505
53607
|
|
|
53608
|
+
export type CountLeadsData = {
|
|
53609
|
+
query?: {
|
|
53610
|
+
/**
|
|
53611
|
+
* Count one connected account only.
|
|
53612
|
+
*/
|
|
53613
|
+
accountId?: string;
|
|
53614
|
+
/**
|
|
53615
|
+
* The platform campaign id the leads came from.
|
|
53616
|
+
*/
|
|
53617
|
+
campaignId?: string;
|
|
53618
|
+
};
|
|
53619
|
+
};
|
|
53620
|
+
|
|
53621
|
+
export type CountLeadsResponse = ({
|
|
53622
|
+
status?: string;
|
|
53623
|
+
counts?: {
|
|
53624
|
+
new?: number;
|
|
53625
|
+
contacted?: number;
|
|
53626
|
+
unreachable?: number;
|
|
53627
|
+
qualified?: number;
|
|
53628
|
+
converted?: number;
|
|
53629
|
+
disqualified?: number;
|
|
53630
|
+
};
|
|
53631
|
+
total?: number;
|
|
53632
|
+
});
|
|
53633
|
+
|
|
53634
|
+
export type CountLeadsError = (ErrorResponse | unknown);
|
|
53635
|
+
|
|
53506
53636
|
export type UpdateLeadData = {
|
|
53507
53637
|
body: {
|
|
53508
53638
|
status: 'new' | 'contacted' | 'unreachable' | 'qualified' | 'converted' | 'disqualified';
|