@getlatedev/node 0.2.1413 → 0.2.1415
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 -1
- package/dist/index.d.mts +105 -16
- package/dist/index.d.ts +105 -16
- package/dist/index.js +8 -1
- package/dist/index.mjs +8 -1
- package/package.json +1 -1
- package/src/client.ts +2 -0
- package/src/generated/sdk.gen.ts +22 -4
- package/src/generated/types.gen.ts +106 -16
|
@@ -1754,10 +1754,13 @@ export type status3 = 'done' | 'skipped' | 'failed';
|
|
|
1754
1754
|
export type AdRuleCondition = {
|
|
1755
1755
|
/**
|
|
1756
1756
|
* `ctr` is a percentage. `spend`, `cpc`, `cpm` and `cpa` are in the ad account currency. `reach` and `frequency` use the platform's de-duplicated reach, so they are accepted on Meta and TikTok only.
|
|
1757
|
+
*
|
|
1758
|
+
* `result:<key>` reads one of your own results (see [Campaign results](/guides/campaign-results)), on campaign rules only: the values you sent for the window, or a formula over them and the platform's numbers. A campaign with no value for it never matches.
|
|
1759
|
+
*
|
|
1757
1760
|
*/
|
|
1758
|
-
metric: 'spend' | 'impressions' | 'clicks' | 'conversions' | 'ctr' | 'cpc' | 'cpm' | 'cpa' | 'roas' | 'reach' | 'frequency';
|
|
1761
|
+
metric: ('spend' | 'impressions' | 'clicks' | 'conversions' | 'ctr' | 'cpc' | 'cpm' | 'cpa' | 'roas' | 'reach' | 'frequency' | unknown);
|
|
1759
1762
|
/**
|
|
1760
|
-
* Days in the ad account's own timezone. `last_7d`
|
|
1763
|
+
* Days in the ad account's own timezone. `last_7d` is the 7 full days before today; only `today` reads the day in progress.
|
|
1761
1764
|
*/
|
|
1762
1765
|
window: 'today' | 'yesterday' | 'last_3d' | 'last_7d' | 'last_14d' | 'last_30d';
|
|
1763
1766
|
op: '>' | '>=' | '<' | '<=';
|
|
@@ -1765,12 +1768,7 @@ export type AdRuleCondition = {
|
|
|
1765
1768
|
};
|
|
1766
1769
|
|
|
1767
1770
|
/**
|
|
1768
|
-
*
|
|
1769
|
-
*/
|
|
1770
|
-
export type metric = 'spend' | 'impressions' | 'clicks' | 'conversions' | 'ctr' | 'cpc' | 'cpm' | 'cpa' | 'roas' | 'reach' | 'frequency';
|
|
1771
|
-
|
|
1772
|
-
/**
|
|
1773
|
-
* Days in the ad account's own timezone. `last_7d` includes today.
|
|
1771
|
+
* Days in the ad account's own timezone. `last_7d` is the 7 full days before today; only `today` reads the day in progress.
|
|
1774
1772
|
*/
|
|
1775
1773
|
export type window = 'today' | 'yesterday' | 'last_3d' | 'last_7d' | 'last_14d' | 'last_30d';
|
|
1776
1774
|
|
|
@@ -2295,6 +2293,12 @@ export type learningStatus = 'LEARNING' | 'SUCCESS' | 'FAIL';
|
|
|
2295
2293
|
* Campaign with nested ad sets and rolled-up metrics
|
|
2296
2294
|
*/
|
|
2297
2295
|
export type AdTreeCampaign = {
|
|
2296
|
+
/**
|
|
2297
|
+
* Only with `results=true`. The values you sent for this campaign over the range, plus each formula they allow, by metric key. A metric with no value is absent.
|
|
2298
|
+
*/
|
|
2299
|
+
results?: {
|
|
2300
|
+
[key: string]: (number);
|
|
2301
|
+
};
|
|
2298
2302
|
platformCampaignId?: string;
|
|
2299
2303
|
platform?: 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter' | 'openai' | 'reddit';
|
|
2300
2304
|
campaignName?: string;
|
|
@@ -2445,6 +2449,10 @@ export type AdTreeResponse = {
|
|
|
2445
2449
|
fromDate?: string;
|
|
2446
2450
|
toDate?: string;
|
|
2447
2451
|
};
|
|
2452
|
+
/**
|
|
2453
|
+
* Only with `results=true`. Your metrics and formulas, to label each campaign's `results`.
|
|
2454
|
+
*/
|
|
2455
|
+
resultMetrics?: Array<CampaignResultMetric>;
|
|
2448
2456
|
/**
|
|
2449
2457
|
* Meta only. Present and true while historical data is being backfilled.
|
|
2450
2458
|
*/
|
|
@@ -4423,6 +4431,10 @@ export type CampaignReport = {
|
|
|
4423
4431
|
* Latest view counts.
|
|
4424
4432
|
*/
|
|
4425
4433
|
total: number;
|
|
4434
|
+
/**
|
|
4435
|
+
* Views from ads, on YouTube and X posts.
|
|
4436
|
+
*/
|
|
4437
|
+
paid: number;
|
|
4426
4438
|
};
|
|
4427
4439
|
/**
|
|
4428
4440
|
* The campaign engagement types summed over the same submissions.
|
|
@@ -4458,11 +4470,25 @@ export type CampaignReport = {
|
|
|
4458
4470
|
export type CampaignResultMetric = {
|
|
4459
4471
|
key: string;
|
|
4460
4472
|
label: string;
|
|
4461
|
-
|
|
4473
|
+
/**
|
|
4474
|
+
* How the value reads: `percent` values are already multiplied by 100.
|
|
4475
|
+
*/
|
|
4476
|
+
kind: 'count' | 'money' | 'percent' | 'ratio';
|
|
4462
4477
|
currency: (string) | null;
|
|
4478
|
+
/**
|
|
4479
|
+
* Null for a number you send. For a computed metric, the formula over `spend`, `impressions`, `clicks`, `conversions`, `purchase_value` and the metrics you send, e.g. `spend / revenue * 100`.
|
|
4480
|
+
*/
|
|
4481
|
+
formula: (string) | null;
|
|
4482
|
+
/**
|
|
4483
|
+
* One of the formulas every team has (`cac_percent`, `cost_per_sale`, `cost_per_qualified_lead`, `lead_to_sale`). Setting the same key replaces it for your team.
|
|
4484
|
+
*/
|
|
4485
|
+
builtIn: boolean;
|
|
4463
4486
|
};
|
|
4464
4487
|
|
|
4465
|
-
|
|
4488
|
+
/**
|
|
4489
|
+
* How the value reads: `percent` values are already multiplied by 100.
|
|
4490
|
+
*/
|
|
4491
|
+
export type kind4 = 'count' | 'money' | 'percent' | 'ratio';
|
|
4466
4492
|
|
|
4467
4493
|
export type CampaignSettlement = {
|
|
4468
4494
|
/**
|
|
@@ -4538,6 +4564,14 @@ export type CampaignSubmission = {
|
|
|
4538
4564
|
* The campaign engagement types summed at the latest read (all four on a views campaign), frozen at the tracking window end like `viewsEligible`. An `engagements` campaign earns on this count.
|
|
4539
4565
|
*/
|
|
4540
4566
|
engagementsLatest: (number) | null;
|
|
4567
|
+
/**
|
|
4568
|
+
* Views from ads the creator ran: YouTube views from the advertising traffic source, X impressions beyond the organic ones. Null on other platforms and before the first read. On an organic-only campaign `viewsEligible` is the latest views minus these.
|
|
4569
|
+
*/
|
|
4570
|
+
viewsPaid: (number) | null;
|
|
4571
|
+
/**
|
|
4572
|
+
* When `viewsPaid` was last read. YouTube refreshes every 6 hours and reports ad views up to 2 days late; X about once a day while the post is under 30 days old.
|
|
4573
|
+
*/
|
|
4574
|
+
paidViewsReadAt: (string) | null;
|
|
4541
4575
|
lastAccruedViews: number;
|
|
4542
4576
|
accruedCents: number;
|
|
4543
4577
|
approvedCents: number;
|
|
@@ -4627,12 +4661,12 @@ export type CampaignSubmissionDetail = CampaignSubmission & {
|
|
|
4627
4661
|
};
|
|
4628
4662
|
|
|
4629
4663
|
export type CampaignSubmissionFlag = {
|
|
4630
|
-
code: 'duplicate_media' | 'duplicate_post' | 'view_spike' | 'linked_accounts' | 'cross_operator' | 'unreachable' | 'post_deleted' | 'account_restricted' | 'low_authenticity' | 'x_read_cap';
|
|
4664
|
+
code: 'duplicate_media' | 'duplicate_post' | 'view_spike' | 'linked_accounts' | 'cross_operator' | 'unreachable' | 'post_deleted' | 'account_restricted' | 'low_authenticity' | 'x_read_cap' | 'paid_views' | 'organic_unverified';
|
|
4631
4665
|
detail: string;
|
|
4632
4666
|
raisedAt: string;
|
|
4633
4667
|
};
|
|
4634
4668
|
|
|
4635
|
-
export type code = 'duplicate_media' | 'duplicate_post' | 'view_spike' | 'linked_accounts' | 'cross_operator' | 'unreachable' | 'post_deleted' | 'account_restricted' | 'low_authenticity' | 'x_read_cap';
|
|
4669
|
+
export type code = 'duplicate_media' | 'duplicate_post' | 'view_spike' | 'linked_accounts' | 'cross_operator' | 'unreachable' | 'post_deleted' | 'account_restricted' | 'low_authenticity' | 'x_read_cap' | 'paid_views' | 'organic_unverified';
|
|
4636
4670
|
|
|
4637
4671
|
/**
|
|
4638
4672
|
* Actions taken on the matched comment itself (comment trigger only; ignored on the
|
|
@@ -6505,6 +6539,10 @@ export type CreatorCampaignEconomicsCpm = {
|
|
|
6505
6539
|
* With `metric: engagements`, the engagements that count. Missing means all four, and sending it on a views campaign answers 400. YouTube reports likes and comments only, Facebook and Threads have no saves, and Pinterest reports saves only.
|
|
6506
6540
|
*/
|
|
6507
6541
|
engagementTypes?: Array<('likes' | 'comments' | 'shares' | 'saves')>;
|
|
6542
|
+
/**
|
|
6543
|
+
* Count only organic views: views from ads the creator ran do not earn. Every campaign platform must be YouTube or X, which report ad views per post, or the request answers 400. A post earns nothing until its ad views were first read.
|
|
6544
|
+
*/
|
|
6545
|
+
organicViewsOnly?: boolean;
|
|
6508
6546
|
ratePer1kCents: number;
|
|
6509
6547
|
/**
|
|
6510
6548
|
* The count a post must reach before it earns, in the campaign metric (views or engagements).
|
|
@@ -6517,7 +6555,7 @@ export type CreatorCampaignEconomicsCpm = {
|
|
|
6517
6555
|
/**
|
|
6518
6556
|
* What the rate pays on. `engagements` counts the `engagementTypes` as each platform reports them, and `minViewsToEarn` then applies to engagements. Fixed once the campaign leaves draft.
|
|
6519
6557
|
*/
|
|
6520
|
-
export type
|
|
6558
|
+
export type metric = 'views' | 'engagements';
|
|
6521
6559
|
|
|
6522
6560
|
export type CreatorCampaignEconomicsPerPost = {
|
|
6523
6561
|
type: 'per_post';
|
|
@@ -6530,6 +6568,10 @@ export type CreatorCampaignEconomicsPool = {
|
|
|
6530
6568
|
type: 'pool';
|
|
6531
6569
|
budgetCents: number;
|
|
6532
6570
|
minViewsToQualify: number;
|
|
6571
|
+
/**
|
|
6572
|
+
* Count only organic views: views from ads the creator ran do not earn. Every campaign platform must be YouTube or X, which report ad views per post, or the request answers 400. A post earns nothing until its ad views were first read.
|
|
6573
|
+
*/
|
|
6574
|
+
organicViewsOnly?: boolean;
|
|
6533
6575
|
};
|
|
6534
6576
|
|
|
6535
6577
|
/**
|
|
@@ -6583,6 +6625,10 @@ export type CreatorPortalEconomics = {
|
|
|
6583
6625
|
* The engagements that count. Missing means all four.
|
|
6584
6626
|
*/
|
|
6585
6627
|
engagementTypes?: Array<('likes' | 'comments' | 'shares' | 'saves')>;
|
|
6628
|
+
/**
|
|
6629
|
+
* Only organic views count; views from ads do not.
|
|
6630
|
+
*/
|
|
6631
|
+
organicViewsOnly?: boolean;
|
|
6586
6632
|
ratePer1kCents: number;
|
|
6587
6633
|
minViewsToEarn: number;
|
|
6588
6634
|
maxPayoutPerClipCents?: number;
|
|
@@ -6594,6 +6640,10 @@ export type CreatorPortalEconomics = {
|
|
|
6594
6640
|
type: 'pool';
|
|
6595
6641
|
poolCents: number;
|
|
6596
6642
|
minViewsToQualify: number;
|
|
6643
|
+
/**
|
|
6644
|
+
* Only organic views count; views from ads do not.
|
|
6645
|
+
*/
|
|
6646
|
+
organicViewsOnly?: boolean;
|
|
6597
6647
|
};
|
|
6598
6648
|
|
|
6599
6649
|
export type type10 = 'cpm';
|
|
@@ -6707,6 +6757,10 @@ export type CreatorPortalSubmission = {
|
|
|
6707
6757
|
* The campaign engagement types summed at the latest read. Null until the post is read.
|
|
6708
6758
|
*/
|
|
6709
6759
|
engagements: (number) | null;
|
|
6760
|
+
/**
|
|
6761
|
+
* Views that came from ads the creator ran, on YouTube and X. Null where the platform does not report them or before the first read.
|
|
6762
|
+
*/
|
|
6763
|
+
viewsFromAds: (number) | null;
|
|
6710
6764
|
earnedCents: number;
|
|
6711
6765
|
rejectReason: (string) | null;
|
|
6712
6766
|
/**
|
|
@@ -10641,7 +10695,7 @@ export type InstagramDemographicsResponse = {
|
|
|
10641
10695
|
note?: string;
|
|
10642
10696
|
};
|
|
10643
10697
|
|
|
10644
|
-
export type
|
|
10698
|
+
export type metric2 = 'follower_demographics' | 'engaged_audience_demographics';
|
|
10645
10699
|
|
|
10646
10700
|
/**
|
|
10647
10701
|
* The timeframe used for demographic data
|
|
@@ -18093,6 +18147,10 @@ export type WebhookPayloadCampaignSubmission = {
|
|
|
18093
18147
|
* The campaign engagement types summed at the latest read. An engagements campaign earns on this count.
|
|
18094
18148
|
*/
|
|
18095
18149
|
engagementsLatest: (number) | null;
|
|
18150
|
+
/**
|
|
18151
|
+
* Views from ads, on YouTube and X. Null elsewhere or before the first read.
|
|
18152
|
+
*/
|
|
18153
|
+
viewsPaid: (number) | null;
|
|
18096
18154
|
flags: Array<{
|
|
18097
18155
|
code: string;
|
|
18098
18156
|
detail: string;
|
|
@@ -50778,6 +50836,30 @@ export type GetCampaignResultsUploadError = (ErrorResponse | {
|
|
|
50778
50836
|
error?: string;
|
|
50779
50837
|
});
|
|
50780
50838
|
|
|
50839
|
+
export type GetCampaignResultsTotalsData = {
|
|
50840
|
+
query: {
|
|
50841
|
+
/**
|
|
50842
|
+
* Comma-separated platform ad account ids, at most 100. Omit for every ad account your key can see.
|
|
50843
|
+
*/
|
|
50844
|
+
adAccountIds?: string;
|
|
50845
|
+
fromDate: string;
|
|
50846
|
+
/**
|
|
50847
|
+
* Inclusive. At most 400 days after `fromDate`.
|
|
50848
|
+
*/
|
|
50849
|
+
toDate: string;
|
|
50850
|
+
};
|
|
50851
|
+
};
|
|
50852
|
+
|
|
50853
|
+
export type GetCampaignResultsTotalsResponse = ({
|
|
50854
|
+
fromDate: string;
|
|
50855
|
+
toDate: string;
|
|
50856
|
+
totals: {
|
|
50857
|
+
[key: string]: (number);
|
|
50858
|
+
};
|
|
50859
|
+
});
|
|
50860
|
+
|
|
50861
|
+
export type GetCampaignResultsTotalsError = (ErrorResponse);
|
|
50862
|
+
|
|
50781
50863
|
export type ListCampaignResultMetricsResponse = ({
|
|
50782
50864
|
metrics: Array<CampaignResultMetric>;
|
|
50783
50865
|
});
|
|
@@ -50787,11 +50869,15 @@ export type ListCampaignResultMetricsError = (ErrorResponse);
|
|
|
50787
50869
|
export type SetCampaignResultMetricData = {
|
|
50788
50870
|
body: {
|
|
50789
50871
|
label: string;
|
|
50790
|
-
kind: 'count' | 'money';
|
|
50872
|
+
kind: 'count' | 'money' | 'percent' | 'ratio';
|
|
50791
50873
|
/**
|
|
50792
50874
|
* ISO 4217, money metrics only.
|
|
50793
50875
|
*/
|
|
50794
50876
|
currency?: (string) | null;
|
|
50877
|
+
/**
|
|
50878
|
+
* Makes it a computed metric. Null or absent for a number you send.
|
|
50879
|
+
*/
|
|
50880
|
+
formula?: (string) | null;
|
|
50795
50881
|
};
|
|
50796
50882
|
path: {
|
|
50797
50883
|
key: string;
|
|
@@ -52804,6 +52890,10 @@ export type GetAdTreeData = {
|
|
|
52804
52890
|
* Profile ID
|
|
52805
52891
|
*/
|
|
52806
52892
|
profileId?: string;
|
|
52893
|
+
/**
|
|
52894
|
+
* Set to `true` to add your own results (see [Campaign results](/guides/campaign-results)): every campaign gains `results`, the values you sent for the range plus each formula they allow, and the response gains `resultMetrics` to label them.
|
|
52895
|
+
*/
|
|
52896
|
+
results?: boolean;
|
|
52807
52897
|
/**
|
|
52808
52898
|
* Case-insensitive substring match on campaign, ad set and ad names (`_`, `%` and spaces match literally), or an exact platform campaign, ad set or ad id.
|
|
52809
52899
|
*
|
|
@@ -68412,7 +68502,7 @@ export type ListCampaignSubmissionsData = {
|
|
|
68412
68502
|
campaignId: string;
|
|
68413
68503
|
};
|
|
68414
68504
|
query?: {
|
|
68415
|
-
flag?: 'duplicate_media' | 'duplicate_post' | 'view_spike' | 'linked_accounts' | 'cross_operator' | 'unreachable' | 'post_deleted' | 'account_restricted' | 'low_authenticity' | 'x_read_cap';
|
|
68505
|
+
flag?: 'duplicate_media' | 'duplicate_post' | 'view_spike' | 'linked_accounts' | 'cross_operator' | 'unreachable' | 'post_deleted' | 'account_restricted' | 'low_authenticity' | 'x_read_cap' | 'paid_views' | 'organic_unverified';
|
|
68416
68506
|
limit?: number;
|
|
68417
68507
|
maxScore?: number;
|
|
68418
68508
|
minScore?: number;
|