@getlatedev/node 0.2.1693 → 0.2.1695
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 +79 -27
- package/dist/index.d.ts +79 -27
- 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 +30 -7
- package/src/generated/types.gen.ts +80 -27
|
@@ -1781,7 +1781,7 @@ export type AdRuleAction = {
|
|
|
1781
1781
|
})>;
|
|
1782
1782
|
} | {
|
|
1783
1783
|
/**
|
|
1784
|
-
* Pause the campaign, ad set or
|
|
1784
|
+
* Pause the campaign, ad set, ad or Google keyword.
|
|
1785
1785
|
*/
|
|
1786
1786
|
type: 'pause';
|
|
1787
1787
|
/**
|
|
@@ -1794,7 +1794,7 @@ export type AdRuleAction = {
|
|
|
1794
1794
|
maxChangesPerObject?: number;
|
|
1795
1795
|
} | {
|
|
1796
1796
|
/**
|
|
1797
|
-
* Reactivate a campaign, ad set or ad a rule paused, once `cooldownMinutes` has passed since the pause. Objects you paused yourself are left alone unless `includeManuallyPaused` is true.
|
|
1797
|
+
* Reactivate a campaign, ad set or ad a rule paused, once `cooldownMinutes` has passed since the pause. A rule on set times (`schedule.times`) does not wait: it restarts only what a rule on set times paused. Objects you paused yourself are left alone unless `includeManuallyPaused` is true.
|
|
1798
1798
|
*/
|
|
1799
1799
|
type: 'activate';
|
|
1800
1800
|
/**
|
|
@@ -2059,9 +2059,9 @@ export type AdRuleActivityEntry = {
|
|
|
2059
2059
|
*/
|
|
2060
2060
|
accountId: string;
|
|
2061
2061
|
adAccountId: string;
|
|
2062
|
-
level: 'campaign' | 'adset';
|
|
2062
|
+
level: 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
2063
2063
|
/**
|
|
2064
|
-
* Platform ID of the campaign or ad
|
|
2064
|
+
* Platform ID of the campaign, ad set or ad. A keyword is `{adGroupId}~{criterionId}`.
|
|
2065
2065
|
*/
|
|
2066
2066
|
objectId: string;
|
|
2067
2067
|
/**
|
|
@@ -2107,7 +2107,7 @@ export type AdRuleActivityEntry = {
|
|
|
2107
2107
|
currency: (string) | null;
|
|
2108
2108
|
};
|
|
2109
2109
|
|
|
2110
|
-
export type level = 'campaign' | 'adset';
|
|
2110
|
+
export type level = 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
2111
2111
|
|
|
2112
2112
|
export type type3 = 'pause' | 'activate' | 'adjust_budget' | 'adjust_bid' | 'adjust_target' | 'reallocate_budget' | 'duplicate' | 'edit_name';
|
|
2113
2113
|
|
|
@@ -2290,7 +2290,7 @@ export type AdRuleEvaluation = {
|
|
|
2290
2290
|
*/
|
|
2291
2291
|
matched: number;
|
|
2292
2292
|
/**
|
|
2293
|
-
* Every delivering campaign or ad
|
|
2293
|
+
* Every delivering campaign, ad set or ad in scope, or every serving keyword and listed search term (for an `activate` rule, the rule-paused objects it may reactivate).
|
|
2294
2294
|
*/
|
|
2295
2295
|
objects: Array<AdRuleObjectEvaluation>;
|
|
2296
2296
|
/**
|
|
@@ -2365,7 +2365,9 @@ export type AdRuleFilters = Array<({
|
|
|
2365
2365
|
*
|
|
2366
2366
|
* The conditions are judged once per group, and a matching group acts on each of its campaigns, each with its own cooldown and daily cap. Paused campaigns count toward a group's totals; only the ones the rule may act on are changed.
|
|
2367
2367
|
*
|
|
2368
|
-
* A group with no filters holds every campaign the rule checks: the whole ad account. A campaign in several groups is acted on once per run, by the first matching group.
|
|
2368
|
+
* A group with no filters holds every campaign the rule checks: the whole ad account. A campaign in several groups is acted on once per run, by the first matching group.
|
|
2369
|
+
*
|
|
2370
|
+
* Reach, frequency and the Google impression shares cannot be added up across campaigns, so a rule with groups cannot use them. It cannot use hourly windows either.
|
|
2369
2371
|
*
|
|
2370
2372
|
* A campaign with no results sent for the window adds its spend and no results to its group. A result sent as a rate (kind `percent` or `ratio`, no formula) reads as unknown for a group; define it as a formula over counts.
|
|
2371
2373
|
*
|
|
@@ -2381,12 +2383,12 @@ export type AdRuleGroups = Array<{
|
|
|
2381
2383
|
/**
|
|
2382
2384
|
* Whether the rule checks campaigns, ad sets, single ads, Google keywords or Google search terms. Each one is evaluated on its own.
|
|
2383
2385
|
*
|
|
2384
|
-
* `keyword` and `search_term` read Google Search, on Google Ads accounts only. A keyword's id is `<adGroupId>~<criterionId>`, as `PATCH /v1/ads/keywords/{keywordId}` takes it. A search term is
|
|
2386
|
+
* `keyword` and `search_term` read Google Search, on Google Ads accounts only. A keyword's id is `<adGroupId>~<criterionId>`, as `PATCH /v1/ads/keywords/{keywordId}` takes it. A search term is judged once per campaign, summed across the ad groups it showed in, its id `<campaignId>~<term>`.
|
|
2385
2387
|
*
|
|
2386
2388
|
* - They read a daily history Zernio fetches from Google. A day keeps its 50,000 rows that spent most.
|
|
2387
2389
|
* - Every daily window works, `today` included: today is refreshed at most once an hour.
|
|
2388
|
-
* -
|
|
2389
|
-
* - A keyword rule judges every serving keyword, one with no traffic at zero.
|
|
2390
|
+
* - The history starts loading when the rule is saved, about 10 days a minute. A run or a preview before it is complete does not evaluate: the run fails and the preview returns 409 `history_loading`.
|
|
2391
|
+
* - A keyword rule judges every serving keyword, one with no traffic at zero. Zernio syncs the keywords Google has not removed; paused keywords are not judged.
|
|
2390
2392
|
* - Google lists only search terms that showed at least once, so a search term rule takes `impressions` with `>` or `>=`, never `<` or `<=`.
|
|
2391
2393
|
*
|
|
2392
2394
|
* They take `spend`, `impressions`, `clicks`, `conversions`, `ctr`, `cpc`, `cpm`, `cpa` and `roas` over whole days, no `usual`, `of`, `top` or `bottom`, and `compareTo` only as `campaign`. A keyword rule can `notify` or `pause`; a search term rule only notifies.
|
|
@@ -2416,7 +2418,7 @@ export type AdRuleLifecycle = {
|
|
|
2416
2418
|
|
|
2417
2419
|
export type AdRuleObjectEvaluation = {
|
|
2418
2420
|
/**
|
|
2419
|
-
* Platform ID of the campaign, ad set or ad. A keyword is `{adGroupId}~{criterionId}`, a search term `{
|
|
2421
|
+
* Platform ID of the campaign, ad set or ad. A keyword is `{adGroupId}~{criterionId}`, a search term `{campaignId}~{term}`.
|
|
2420
2422
|
*/
|
|
2421
2423
|
id: string;
|
|
2422
2424
|
/**
|
|
@@ -2544,8 +2546,6 @@ export type AdRuleRun = {
|
|
|
2544
2546
|
error: (string) | null;
|
|
2545
2547
|
};
|
|
2546
2548
|
|
|
2547
|
-
export type level2 = 'campaign' | 'adset' | 'ad' | 'keyword' | 'search_term';
|
|
2548
|
-
|
|
2549
2549
|
/**
|
|
2550
2550
|
* Either `everyMinutes` or `times`. Sending a schedule replaces the rule's whole timing. Without one, a new rule runs every 60 minutes.
|
|
2551
2551
|
*/
|
|
@@ -2632,7 +2632,7 @@ export type kind = 'ad_rejected' | 'delivery_issue' | 'payment' | 'budget_limite
|
|
|
2632
2632
|
|
|
2633
2633
|
export type severity = 'error' | 'warning' | 'info';
|
|
2634
2634
|
|
|
2635
|
-
export type
|
|
2635
|
+
export type level2 = 'ad_account' | 'campaign' | 'ad_set' | 'ad';
|
|
2636
2636
|
|
|
2637
2637
|
/**
|
|
2638
2638
|
* One ad schedule window as Google stores it. Half-open: it is exclusive of the end minute, so 09:00-12:00 and 12:00-17:00 are adjacent, not overlapping.
|
|
@@ -4205,7 +4205,7 @@ export type AutomationControls = {
|
|
|
4205
4205
|
/**
|
|
4206
4206
|
* An automation of one of three kinds, told apart by its shape:
|
|
4207
4207
|
*
|
|
4208
|
-
* - **Ad rule**: a `schedule` trigger over campaigns, ad sets or
|
|
4208
|
+
* - **Ad rule**: a `schedule` trigger over campaigns, ad sets, ads, Google keywords or Google search terms, with metric `conditions` and ad `steps`.
|
|
4209
4209
|
* - **Event**: a Zernio event in `trigger.type`, narrowed by `trigger.filter`, with notify steps, or none to only record each matching event as a check.
|
|
4210
4210
|
* - **Scheduled**: a `schedule` trigger over `subjects.each: post`, narrowed by `filter`, with notify and boost steps.
|
|
4211
4211
|
*
|
|
@@ -4296,7 +4296,7 @@ export type AutomationLimits = {
|
|
|
4296
4296
|
*/
|
|
4297
4297
|
maxChangesPerDay?: number;
|
|
4298
4298
|
/**
|
|
4299
|
-
* Most times the rule may change one object, over
|
|
4299
|
+
* Most times the rule may change one object, counted over the last 400 days. Needs an `ads.*` step.
|
|
4300
4300
|
*/
|
|
4301
4301
|
maxChangesPerObject?: number;
|
|
4302
4302
|
};
|
|
@@ -4666,7 +4666,7 @@ export type AutomationSubjects = {
|
|
|
4666
4666
|
/**
|
|
4667
4667
|
* Judges campaigns together (campaign rules only): each group's numbers are summed and its rates computed on the totals, and a matching group acts on each of its campaigns.
|
|
4668
4668
|
*
|
|
4669
|
-
* A group with no filters holds every campaign the rule checks. `reach` and
|
|
4669
|
+
* A group with no filters holds every campaign the rule checks. `reach`, `frequency`, the Google impression shares and hourly windows cannot be used with groups.
|
|
4670
4670
|
*
|
|
4671
4671
|
*/
|
|
4672
4672
|
groups?: Array<{
|
|
@@ -13140,7 +13140,7 @@ export type GoogleListingGroupDimension = {
|
|
|
13140
13140
|
};
|
|
13141
13141
|
};
|
|
13142
13142
|
|
|
13143
|
-
export type
|
|
13143
|
+
export type level3 = 'LEVEL1' | 'LEVEL2' | 'LEVEL3' | 'LEVEL4' | 'LEVEL5';
|
|
13144
13144
|
|
|
13145
13145
|
export type condition = 'NEW' | 'REFURBISHED' | 'USED';
|
|
13146
13146
|
|
|
@@ -21699,7 +21699,7 @@ export type event10 = 'ad.created';
|
|
|
21699
21699
|
/**
|
|
21700
21700
|
* Always `AD`.
|
|
21701
21701
|
*/
|
|
21702
|
-
export type
|
|
21702
|
+
export type level4 = 'AD';
|
|
21703
21703
|
|
|
21704
21704
|
/**
|
|
21705
21705
|
* Where the ad was created. `zernio` for ads created through Zernio, `platform` for ads the sync detected.
|
|
@@ -21843,7 +21843,7 @@ export type status64 = 'approved' | 'rejected';
|
|
|
21843
21843
|
/**
|
|
21844
21844
|
* Webhook payload for the `ad_rule.triggered` event.
|
|
21845
21845
|
*
|
|
21846
|
-
* Fires when a scheduled run of a rule with a `notify` action finds campaigns, ad sets or
|
|
21846
|
+
* Fires when a scheduled run of a rule with a `notify` action finds campaigns, ad sets, ads, Google keywords or Google search terms that meet every condition of the rule.
|
|
21847
21847
|
*
|
|
21848
21848
|
* 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.
|
|
21849
21849
|
*
|
|
@@ -21904,11 +21904,11 @@ export type WebhookPayloadAdRuleTriggered = {
|
|
|
21904
21904
|
currency: (string) | null;
|
|
21905
21905
|
};
|
|
21906
21906
|
/**
|
|
21907
|
-
* The
|
|
21907
|
+
* The objects this run acted on, at the rule's `level` (campaigns, ad sets, ads, keywords or search terms), including those whose action failed. Objects still in cooldown are left out.
|
|
21908
21908
|
*/
|
|
21909
21909
|
objects: Array<{
|
|
21910
21910
|
/**
|
|
21911
|
-
* Platform-native ID of the campaign or ad
|
|
21911
|
+
* Platform-native ID of the campaign, ad set or ad. A keyword is `{adGroupId}~{criterionId}`, a search term `{campaignId}~{term}`.
|
|
21912
21912
|
*/
|
|
21913
21913
|
platformId: string;
|
|
21914
21914
|
/**
|
|
@@ -22069,7 +22069,7 @@ export type event14 = 'ad_set.created';
|
|
|
22069
22069
|
/**
|
|
22070
22070
|
* Always `AD_SET`.
|
|
22071
22071
|
*/
|
|
22072
|
-
export type
|
|
22072
|
+
export type level5 = 'AD_SET';
|
|
22073
22073
|
|
|
22074
22074
|
/**
|
|
22075
22075
|
* Webhook payload for the `ad_set.updated` event. Fires when an ad set is edited through Zernio (API, MCP or dashboard), after the platform and Zernio both accepted the edit, once per user who can see the ad set. It also fires when the sync detects an edit made outside Zernio.
|
|
@@ -22263,7 +22263,7 @@ export type event16 = 'ad.status_changed';
|
|
|
22263
22263
|
/**
|
|
22264
22264
|
* Hierarchy level the status applies to. Mirrors Meta's `level`. Creative-level events are not forwarded.
|
|
22265
22265
|
*/
|
|
22266
|
-
export type
|
|
22266
|
+
export type level6 = 'CAMPAIGN' | 'AD_SET' | 'AD';
|
|
22267
22267
|
|
|
22268
22268
|
/**
|
|
22269
22269
|
* Webhook payload for the `ad.updated` event. Fires when an ad is edited through Zernio (API, MCP or dashboard), after the platform and Zernio both accepted the edit, or when the sync detects an edit made outside Zernio. It is sent once, to the owner of the edited ad.
|
|
@@ -23224,7 +23224,7 @@ export type event34 = 'campaign.budget.depleted';
|
|
|
23224
23224
|
/**
|
|
23225
23225
|
* Always `CAMPAIGN`.
|
|
23226
23226
|
*/
|
|
23227
|
-
export type
|
|
23227
|
+
export type level7 = 'CAMPAIGN';
|
|
23228
23228
|
|
|
23229
23229
|
/**
|
|
23230
23230
|
* Webhook payload for the `campaign.created` event. Fires when a campaign is created through Zernio (API, MCP or dashboard) or detected by the sync, once per campaign, after its row is recorded so `GET /v1/ads/campaigns/{campaignId}` finds it.
|
|
@@ -27761,12 +27761,13 @@ export type WorkflowNode = {
|
|
|
27761
27761
|
*
|
|
27762
27762
|
* Template `variableMapping` entries with `field: custom` interpolate `{{...}}` in `customValue`. An array or object interpolated into text renders as JSON.
|
|
27763
27763
|
*
|
|
27764
|
-
* **send_message**: `{ messageType: text|template|media|interactive|cards, text, template, media:{mediaType:image|video|audio|document, url,caption}, interactive, buttons, quickReplies, messageTag }`.
|
|
27764
|
+
* **send_message**: `{ messageType: text|template|media|interactive|cards, text, template, media:{mediaType:image|video|audio|document, url,caption,filename}, interactive, buttons, quickReplies, messageTag }`.
|
|
27765
27765
|
*
|
|
27766
27766
|
* - `template` is `{name,language,variableMapping}` for `messageType: template`, and `{ type: generic, elements:[{ title, subtitle, imageUrl, buttons }] }` (1 to 10 cards) for `messageType: cards`.
|
|
27767
27767
|
* - `template` and `interactive` are WhatsApp-only. `interactive.type` is inferred from the payload shape when omitted; payloads with neither `type` nor an inferable shape are rejected.
|
|
27768
27768
|
* - Facebook and Instagram only (a 400 on other platforms; WhatsApp keeps `interactive`): `cards`, `buttons` on `text` (cards carry their own buttons), and `quickReplies` / `messageTag` on `text`, `media` and `cards`.
|
|
27769
27769
|
* - `media` takes no `buttons` (a 400 at save).
|
|
27770
|
+
* - `media.filename` (WhatsApp documents only): the file name the recipient sees, including its extension (e.g. Brochure.pdf). Without it WhatsApp names the file itself and it may not open.
|
|
27770
27771
|
* - `buttons:[{ type: url|postback|phone, title, url, payload, phone, workflowId }]`: 1 to 3, text only (the text then 640 characters at most), sent as Meta's button_template, not inside cards. `phone` is Facebook-only.
|
|
27771
27772
|
* - `quickReplies:[{ title, payload, imageUrl, workflowId }]`: 1 to 13, not combined with `buttons`.
|
|
27772
27773
|
* - `messageTag` is not available: a workflow only sends within the 24h window, and `HUMAN_AGENT` is rejected with a 400 because it is only for replies typed by a person.
|
|
@@ -60859,6 +60860,58 @@ export type PreviewAdRuleError = (ErrorResponse | {
|
|
|
60859
60860
|
error?: string;
|
|
60860
60861
|
});
|
|
60861
60862
|
|
|
60863
|
+
export type ListAdAccountRuleAlertsData = {
|
|
60864
|
+
query: {
|
|
60865
|
+
/**
|
|
60866
|
+
* The connected ads account the rules run on.
|
|
60867
|
+
*/
|
|
60868
|
+
accountId: string;
|
|
60869
|
+
/**
|
|
60870
|
+
* The platform ad account ID.
|
|
60871
|
+
*/
|
|
60872
|
+
adAccountId: string;
|
|
60873
|
+
/**
|
|
60874
|
+
* `nextCursor` from the previous page.
|
|
60875
|
+
*/
|
|
60876
|
+
cursor?: string;
|
|
60877
|
+
limit?: number;
|
|
60878
|
+
};
|
|
60879
|
+
};
|
|
60880
|
+
|
|
60881
|
+
export type ListAdAccountRuleAlertsResponse = ({
|
|
60882
|
+
alerts: Array<{
|
|
60883
|
+
/**
|
|
60884
|
+
* The rule the alert belongs to.
|
|
60885
|
+
*/
|
|
60886
|
+
ruleId: string;
|
|
60887
|
+
id: string;
|
|
60888
|
+
/**
|
|
60889
|
+
* Platform campaign, ad set or ad ID, or the id of the keyword or search term.
|
|
60890
|
+
*/
|
|
60891
|
+
objectId: string;
|
|
60892
|
+
state: 'open';
|
|
60893
|
+
severity: ('warning' | 'critical') | null;
|
|
60894
|
+
consecutiveMatches: number;
|
|
60895
|
+
openedAt: (string) | null;
|
|
60896
|
+
lastMatchedAt: string;
|
|
60897
|
+
/**
|
|
60898
|
+
* When a run last evaluated the object of this alert. Older than the latest run of its rule means that run did not evaluate it.
|
|
60899
|
+
*/
|
|
60900
|
+
lastEvaluatedAt: string;
|
|
60901
|
+
/**
|
|
60902
|
+
* Always null here: only open alerts are listed.
|
|
60903
|
+
*/
|
|
60904
|
+
resolvedAt: (string) | null;
|
|
60905
|
+
/**
|
|
60906
|
+
* Always null here: only open alerts are listed.
|
|
60907
|
+
*/
|
|
60908
|
+
resolvedReason: (string) | null;
|
|
60909
|
+
}>;
|
|
60910
|
+
nextCursor: (string) | null;
|
|
60911
|
+
});
|
|
60912
|
+
|
|
60913
|
+
export type ListAdAccountRuleAlertsError = (ErrorResponse);
|
|
60914
|
+
|
|
60862
60915
|
export type ListAdRuleAlertsData = {
|
|
60863
60916
|
path: {
|
|
60864
60917
|
ruleId: string;
|
|
@@ -60877,7 +60930,7 @@ export type ListAdRuleAlertsResponse = ({
|
|
|
60877
60930
|
alerts: Array<{
|
|
60878
60931
|
id: string;
|
|
60879
60932
|
/**
|
|
60880
|
-
* Platform campaign, ad set or ad ID.
|
|
60933
|
+
* Platform campaign, ad set or ad ID, or the id of the keyword or search term.
|
|
60881
60934
|
*/
|
|
60882
60935
|
objectId: string;
|
|
60883
60936
|
state: 'pending' | 'open' | 'resolved';
|