@getlatedev/node 0.2.1410 → 0.2.1412
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 +1 -0
- package/dist/index.d.mts +94 -20
- package/dist/index.d.ts +94 -20
- 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 +15 -1
- package/src/generated/types.gen.ts +96 -19
|
@@ -1660,17 +1660,25 @@ export type AdRuleAction = {
|
|
|
1660
1660
|
type: 'notify';
|
|
1661
1661
|
} | {
|
|
1662
1662
|
/**
|
|
1663
|
-
* Pause the campaign or ad
|
|
1663
|
+
* Pause the campaign, ad set or ad.
|
|
1664
1664
|
*/
|
|
1665
1665
|
type: 'pause';
|
|
1666
|
+
/**
|
|
1667
|
+
* At most this many objects changed in any 24 hours, across runs. Matches over the limit are skipped with `daily_limit_reached` and tried again later.
|
|
1668
|
+
*/
|
|
1669
|
+
maxChangesPerDay?: number;
|
|
1666
1670
|
} | {
|
|
1667
1671
|
/**
|
|
1668
|
-
* Reactivate a campaign or ad
|
|
1672
|
+
* Reactivate a campaign, ad set or ad a rule paused, once `cooldownMinutes` has passed since the pause. Objects you paused yourself are never touched.
|
|
1669
1673
|
*/
|
|
1670
1674
|
type: 'activate';
|
|
1675
|
+
/**
|
|
1676
|
+
* At most this many objects changed in any 24 hours, across runs. Matches over the limit are skipped with `daily_limit_reached` and tried again later.
|
|
1677
|
+
*/
|
|
1678
|
+
maxChangesPerDay?: number;
|
|
1671
1679
|
} | {
|
|
1672
1680
|
/**
|
|
1673
|
-
* Change the daily budget.
|
|
1681
|
+
* Change the daily budget. Not on ad-level rules (an ad has no budget), and on Google it needs a campaign-level rule (ad groups have no budget of their own).
|
|
1674
1682
|
*/
|
|
1675
1683
|
type: 'adjust_budget';
|
|
1676
1684
|
direction: 'increase' | 'decrease';
|
|
@@ -1682,6 +1690,10 @@ export type AdRuleAction = {
|
|
|
1682
1690
|
* The budget never goes above this on an increase, or below it on a decrease, in the ad account currency.
|
|
1683
1691
|
*/
|
|
1684
1692
|
limit: number;
|
|
1693
|
+
/**
|
|
1694
|
+
* At most this many objects changed in any 24 hours, across runs. Matches over the limit are skipped with `daily_limit_reached` and tried again later.
|
|
1695
|
+
*/
|
|
1696
|
+
maxChangesPerDay?: number;
|
|
1685
1697
|
};
|
|
1686
1698
|
|
|
1687
1699
|
/**
|
|
@@ -1741,9 +1753,9 @@ export type status3 = 'done' | 'skipped' | 'failed';
|
|
|
1741
1753
|
|
|
1742
1754
|
export type AdRuleCondition = {
|
|
1743
1755
|
/**
|
|
1744
|
-
* `ctr` is a percentage. `spend`, `cpc`, `cpm` and `cpa` are in the ad account currency.
|
|
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.
|
|
1745
1757
|
*/
|
|
1746
|
-
metric: 'spend' | 'impressions' | 'clicks' | 'conversions' | 'ctr' | 'cpc' | 'cpm' | 'cpa' | 'roas';
|
|
1758
|
+
metric: 'spend' | 'impressions' | 'clicks' | 'conversions' | 'ctr' | 'cpc' | 'cpm' | 'cpa' | 'roas' | 'reach' | 'frequency';
|
|
1747
1759
|
/**
|
|
1748
1760
|
* Days in the ad account's own timezone. `last_7d` includes today.
|
|
1749
1761
|
*/
|
|
@@ -1753,9 +1765,9 @@ export type AdRuleCondition = {
|
|
|
1753
1765
|
};
|
|
1754
1766
|
|
|
1755
1767
|
/**
|
|
1756
|
-
* `ctr` is a percentage. `spend`, `cpc`, `cpm` and `cpa` are in the ad account currency.
|
|
1768
|
+
* `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
1769
|
*/
|
|
1758
|
-
export type metric = 'spend' | 'impressions' | 'clicks' | 'conversions' | 'ctr' | 'cpc' | 'cpm' | 'cpa' | 'roas';
|
|
1770
|
+
export type metric = 'spend' | 'impressions' | 'clicks' | 'conversions' | 'ctr' | 'cpc' | 'cpm' | 'cpa' | 'roas' | 'reach' | 'frequency';
|
|
1759
1771
|
|
|
1760
1772
|
/**
|
|
1761
1773
|
* Days in the ad account's own timezone. `last_7d` includes today.
|
|
@@ -1797,9 +1809,9 @@ export type AdRuleEvaluation = {
|
|
|
1797
1809
|
};
|
|
1798
1810
|
|
|
1799
1811
|
/**
|
|
1800
|
-
* Whether the rule checks campaigns or
|
|
1812
|
+
* Whether the rule checks campaigns, ad sets or single ads. Each one is evaluated on its own.
|
|
1801
1813
|
*/
|
|
1802
|
-
export type AdRuleLevel = 'campaign' | 'adset';
|
|
1814
|
+
export type AdRuleLevel = 'campaign' | 'adset' | 'ad';
|
|
1803
1815
|
|
|
1804
1816
|
export type AdRuleObjectEvaluation = {
|
|
1805
1817
|
/**
|
|
@@ -4412,6 +4424,10 @@ export type CampaignReport = {
|
|
|
4412
4424
|
*/
|
|
4413
4425
|
total: number;
|
|
4414
4426
|
};
|
|
4427
|
+
/**
|
|
4428
|
+
* The campaign engagement types summed over the same submissions.
|
|
4429
|
+
*/
|
|
4430
|
+
engagements: number;
|
|
4415
4431
|
submissions: CampaignSubmissionCounts;
|
|
4416
4432
|
/**
|
|
4417
4433
|
* Top 10 participants by payable, settling and settled cents.
|
|
@@ -4509,6 +4525,10 @@ export type CampaignSubmission = {
|
|
|
4509
4525
|
* Views that count toward earnings: every view the platform reports for the post, including those before submission, read at the tracking window end at the latest: once the window completes or is cancelled, the last read at or before its end is final and this value stops moving.
|
|
4510
4526
|
*/
|
|
4511
4527
|
viewsEligible: (number) | null;
|
|
4528
|
+
/**
|
|
4529
|
+
* 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.
|
|
4530
|
+
*/
|
|
4531
|
+
engagementsLatest: (number) | null;
|
|
4512
4532
|
lastAccruedViews: number;
|
|
4513
4533
|
accruedCents: number;
|
|
4514
4534
|
approvedCents: number;
|
|
@@ -6459,7 +6479,7 @@ export type CreatorCampaignCaps = {
|
|
|
6459
6479
|
*
|
|
6460
6480
|
* Every type carries `budgetCents`, the most the campaign can pay out in total. Once earnings reach it, the campaign stops accruing and `creator_campaign.budget_exhausted` fires.
|
|
6461
6481
|
*
|
|
6462
|
-
* - `cpm`: `ratePer1kCents` per 1,000
|
|
6482
|
+
* - `cpm`: `ratePer1kCents` per 1,000 of the counted `metric` (views by default), earned once a post reaches `minViewsToEarn` of it, capped per post by `maxPayoutPerClipCents`.
|
|
6463
6483
|
* - `per_post`: `perApprovedPostCents` for each approved post, at most `maxPostsPerParticipant` per participant.
|
|
6464
6484
|
* - `pool`: `budgetCents` is split at close among approved posts by eligible views; a post needs `minViewsToQualify` views to share.
|
|
6465
6485
|
*
|
|
@@ -6468,12 +6488,28 @@ export type CreatorCampaignEconomics = CreatorCampaignEconomicsCpm | CreatorCamp
|
|
|
6468
6488
|
|
|
6469
6489
|
export type CreatorCampaignEconomicsCpm = {
|
|
6470
6490
|
type: 'cpm';
|
|
6491
|
+
/**
|
|
6492
|
+
* 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.
|
|
6493
|
+
*/
|
|
6494
|
+
metric?: 'views' | 'engagements';
|
|
6495
|
+
/**
|
|
6496
|
+
* 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.
|
|
6497
|
+
*/
|
|
6498
|
+
engagementTypes?: Array<('likes' | 'comments' | 'shares' | 'saves')>;
|
|
6471
6499
|
ratePer1kCents: number;
|
|
6500
|
+
/**
|
|
6501
|
+
* The count a post must reach before it earns, in the campaign metric (views or engagements).
|
|
6502
|
+
*/
|
|
6472
6503
|
minViewsToEarn: number;
|
|
6473
6504
|
maxPayoutPerClipCents?: number;
|
|
6474
6505
|
budgetCents: number;
|
|
6475
6506
|
};
|
|
6476
6507
|
|
|
6508
|
+
/**
|
|
6509
|
+
* 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.
|
|
6510
|
+
*/
|
|
6511
|
+
export type metric2 = 'views' | 'engagements';
|
|
6512
|
+
|
|
6477
6513
|
export type CreatorCampaignEconomicsPerPost = {
|
|
6478
6514
|
type: 'per_post';
|
|
6479
6515
|
perApprovedPostCents: number;
|
|
@@ -6530,6 +6566,14 @@ export type CreatorPortalCampaign = {
|
|
|
6530
6566
|
*/
|
|
6531
6567
|
export type CreatorPortalEconomics = {
|
|
6532
6568
|
type: 'cpm';
|
|
6569
|
+
/**
|
|
6570
|
+
* What the rate pays on. Missing means views.
|
|
6571
|
+
*/
|
|
6572
|
+
metric?: 'views' | 'engagements';
|
|
6573
|
+
/**
|
|
6574
|
+
* The engagements that count. Missing means all four.
|
|
6575
|
+
*/
|
|
6576
|
+
engagementTypes?: Array<('likes' | 'comments' | 'shares' | 'saves')>;
|
|
6533
6577
|
ratePer1kCents: number;
|
|
6534
6578
|
minViewsToEarn: number;
|
|
6535
6579
|
maxPayoutPerClipCents?: number;
|
|
@@ -6650,6 +6694,10 @@ export type CreatorPortalSubmission = {
|
|
|
6650
6694
|
* Latest view count read for the post.
|
|
6651
6695
|
*/
|
|
6652
6696
|
views: number;
|
|
6697
|
+
/**
|
|
6698
|
+
* The campaign engagement types summed at the latest read. Null until the post is read.
|
|
6699
|
+
*/
|
|
6700
|
+
engagements: (number) | null;
|
|
6653
6701
|
earnedCents: number;
|
|
6654
6702
|
rejectReason: (string) | null;
|
|
6655
6703
|
/**
|
|
@@ -10584,7 +10632,7 @@ export type InstagramDemographicsResponse = {
|
|
|
10584
10632
|
note?: string;
|
|
10585
10633
|
};
|
|
10586
10634
|
|
|
10587
|
-
export type
|
|
10635
|
+
export type metric3 = 'follower_demographics' | 'engaged_audience_demographics';
|
|
10588
10636
|
|
|
10589
10637
|
/**
|
|
10590
10638
|
* The timeframe used for demographic data
|
|
@@ -17130,7 +17178,7 @@ export type status52 = 'approved' | 'rejected';
|
|
|
17130
17178
|
/**
|
|
17131
17179
|
* Webhook payload for the `ad_rule.triggered` event.
|
|
17132
17180
|
*
|
|
17133
|
-
* Fires when a scheduled run of a rule with a `notify` action finds campaigns
|
|
17181
|
+
* Fires when a scheduled run of a rule with a `notify` action finds campaigns, ad sets or ads that meet every condition of the rule.
|
|
17134
17182
|
*
|
|
17135
17183
|
* Each object is announced at most once per rule cooldown, so `objects` lists only the objects the run acted on, never the ones still in cooldown. A run where every matching object is still in cooldown sends nothing.
|
|
17136
17184
|
*
|
|
@@ -17156,9 +17204,9 @@ export type WebhookPayloadAdRuleTriggered = {
|
|
|
17156
17204
|
id: string;
|
|
17157
17205
|
name: string;
|
|
17158
17206
|
/**
|
|
17159
|
-
* Whether the rule evaluates campaigns
|
|
17207
|
+
* Whether the rule evaluates campaigns, ad sets or ads.
|
|
17160
17208
|
*/
|
|
17161
|
-
level: 'campaign' | 'adset';
|
|
17209
|
+
level: 'campaign' | 'adset' | 'ad';
|
|
17162
17210
|
/**
|
|
17163
17211
|
* Platform-native ad account ID the rule watches.
|
|
17164
17212
|
*/
|
|
@@ -17191,7 +17239,7 @@ export type WebhookPayloadAdRuleTriggered = {
|
|
|
17191
17239
|
currency: (string) | null;
|
|
17192
17240
|
};
|
|
17193
17241
|
/**
|
|
17194
|
-
* The campaigns
|
|
17242
|
+
* The campaigns, ad sets or ads this run acted on, at the rule's `level`, including those whose action failed. Objects still in cooldown are left out.
|
|
17195
17243
|
*/
|
|
17196
17244
|
objects: Array<{
|
|
17197
17245
|
/**
|
|
@@ -17241,7 +17289,7 @@ export type WebhookPayloadAdRuleTriggered = {
|
|
|
17241
17289
|
*/
|
|
17242
17290
|
status: 'done' | 'skipped' | 'failed';
|
|
17243
17291
|
/**
|
|
17244
|
-
* Why the action was skipped or failed: `already_paused`, `already_active`, `at_limit`, `budget_unknown`, `budget_not_daily`, `budget_level_mismatch`, `no_live_ads`, `ads_allowance_exceeded` (a reactivation or budget increase for a team past its free live-ads allowance), or the platform's message. Null when done.
|
|
17292
|
+
* Why the action was skipped or failed: `already_paused`, `already_active`, `at_limit`, `budget_unknown`, `budget_not_daily`, `budget_level_mismatch`, `no_live_ads`, `daily_limit_reached` (held back by the action's `maxChangesPerDay`), `ads_allowance_exceeded` (a reactivation or budget increase for a team past its free live-ads allowance), or the platform's message. Null when done.
|
|
17245
17293
|
*/
|
|
17246
17294
|
reason: (string) | null;
|
|
17247
17295
|
/**
|
|
@@ -17262,6 +17310,11 @@ export type WebhookPayloadAdRuleTriggered = {
|
|
|
17262
17310
|
|
|
17263
17311
|
export type event11 = 'ad_rule.triggered';
|
|
17264
17312
|
|
|
17313
|
+
/**
|
|
17314
|
+
* Whether the rule evaluates campaigns, ad sets or ads.
|
|
17315
|
+
*/
|
|
17316
|
+
export type level5 = 'campaign' | 'adset' | 'ad';
|
|
17317
|
+
|
|
17265
17318
|
/**
|
|
17266
17319
|
* Webhook payload for the `ad.status_changed` event. Currently emitted
|
|
17267
17320
|
* only for Meta (`metaads`).
|
|
@@ -17392,7 +17445,7 @@ export type event12 = 'ad.status_changed';
|
|
|
17392
17445
|
/**
|
|
17393
17446
|
* Hierarchy level the status applies to. Mirrors Meta's `level`. Creative-level events are not forwarded.
|
|
17394
17447
|
*/
|
|
17395
|
-
export type
|
|
17448
|
+
export type level6 = 'CAMPAIGN' | 'AD_SET' | 'AD';
|
|
17396
17449
|
|
|
17397
17450
|
/**
|
|
17398
17451
|
* Webhook payload for the `ad.video.processed` event. Fires once per
|
|
@@ -17851,7 +17904,7 @@ export type event21 = 'campaign.budget.depleted';
|
|
|
17851
17904
|
/**
|
|
17852
17905
|
* Always `CAMPAIGN`.
|
|
17853
17906
|
*/
|
|
17854
|
-
export type
|
|
17907
|
+
export type level7 = 'CAMPAIGN';
|
|
17855
17908
|
|
|
17856
17909
|
/**
|
|
17857
17910
|
* Webhook payload for `campaign_participant.joined`, `campaign_participant.suspended` and
|
|
@@ -18023,6 +18076,14 @@ export type WebhookPayloadCampaignSubmission = {
|
|
|
18023
18076
|
platformPostUrl: (string) | null;
|
|
18024
18077
|
status: string;
|
|
18025
18078
|
viewsAtSubmission: (number) | null;
|
|
18079
|
+
/**
|
|
18080
|
+
* Views that count toward earnings at the latest read.
|
|
18081
|
+
*/
|
|
18082
|
+
viewsEligible: (number) | null;
|
|
18083
|
+
/**
|
|
18084
|
+
* The campaign engagement types summed at the latest read. An engagements campaign earns on this count.
|
|
18085
|
+
*/
|
|
18086
|
+
engagementsLatest: (number) | null;
|
|
18026
18087
|
flags: Array<{
|
|
18027
18088
|
code: string;
|
|
18028
18089
|
detail: string;
|
|
@@ -50462,6 +50523,22 @@ export type CreateAdRuleResponse = ({
|
|
|
50462
50523
|
|
|
50463
50524
|
export type CreateAdRuleError = (ErrorResponse);
|
|
50464
50525
|
|
|
50526
|
+
export type ListAdRuleTemplatesResponse = ({
|
|
50527
|
+
templates: Array<{
|
|
50528
|
+
id: string;
|
|
50529
|
+
name: string;
|
|
50530
|
+
description: string;
|
|
50531
|
+
level: AdRuleLevel;
|
|
50532
|
+
conditions: AdRuleConditions;
|
|
50533
|
+
actions: AdRuleActions;
|
|
50534
|
+
schedule: AdRuleSchedule;
|
|
50535
|
+
cooldownMinutes: number;
|
|
50536
|
+
platforms: Array<(string)> | null;
|
|
50537
|
+
}>;
|
|
50538
|
+
});
|
|
50539
|
+
|
|
50540
|
+
export type ListAdRuleTemplatesError = (ErrorResponse);
|
|
50541
|
+
|
|
50465
50542
|
export type ListAdRuleActivityData = {
|
|
50466
50543
|
query?: {
|
|
50467
50544
|
/**
|
|
@@ -68198,7 +68275,7 @@ export type ListCampaignSubmissionsData = {
|
|
|
68198
68275
|
/**
|
|
68199
68276
|
* What to sort by. Posts with no value to sort by (not read yet, not scored) come last in either direction.
|
|
68200
68277
|
*/
|
|
68201
|
-
sort?: 'submittedAt' | 'viewsEligible' | 'earnedCents' | 'authenticityScore';
|
|
68278
|
+
sort?: 'submittedAt' | 'viewsEligible' | 'engagementsLatest' | 'earnedCents' | 'authenticityScore';
|
|
68202
68279
|
status?: 'received' | 'tracking' | 'pending_review' | 'approved' | 'rejected' | 'expired' | 'withdrawn';
|
|
68203
68280
|
};
|
|
68204
68281
|
};
|