@zernio/node 0.2.1513 → 0.2.1514

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/dist/index.js CHANGED
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(index_exports);
36
36
  // package.json
37
37
  var package_default = {
38
38
  name: "@zernio/node",
39
- version: "0.2.1513",
39
+ version: "0.2.1514",
40
40
  description: "The official Node.js library for the Zernio API",
41
41
  main: "dist/index.js",
42
42
  module: "dist/index.mjs",
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5
5
  // package.json
6
6
  var package_default = {
7
7
  name: "@zernio/node",
8
- version: "0.2.1513",
8
+ version: "0.2.1514",
9
9
  description: "The official Node.js library for the Zernio API",
10
10
  main: "dist/index.js",
11
11
  module: "dist/index.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zernio/node",
3
- "version": "0.2.1513",
3
+ "version": "0.2.1514",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -1804,7 +1804,90 @@ export type AdRuleAction = {
1804
1804
  maxChangesPerObject?: number;
1805
1805
  } | {
1806
1806
  /**
1807
- * Tag the object by its name. Meta, Google and LinkedIn campaigns and ad sets, and TikTok campaigns, ad groups and ads. An object whose name already has the tag (or lacks it, for `remove`) is skipped with `name_unchanged`.
1807
+ * Move a Google campaign's target CPA or target ROAS inside the strategy it is on (Target CPA or Maximize conversions for `cpa`, Target ROAS or Maximize conversion value for `roas`), never switching strategies. Campaign rules on Google only. Skipped with `portfolio_bid_strategy` on a portfolio strategy, `unsupported_bid_strategy` on one with no target (Manual CPC, Maximize clicks), and `no_target_cpa` or `no_target_roas` when the strategy holds no such target. A target CPA in a zero-decimal currency is rounded to whole units.
1808
+ */
1809
+ type: 'adjust_target';
1810
+ /**
1811
+ * Which target moves: `cpa` in the ad account currency, `roas` as a ratio (3 is 300%).
1812
+ */
1813
+ target: 'cpa' | 'roas';
1814
+ /**
1815
+ * The target to set.
1816
+ */
1817
+ amount?: number;
1818
+ direction?: 'increase' | 'decrease';
1819
+ /**
1820
+ * Step size. A decrease is at most 90.
1821
+ */
1822
+ percent?: number;
1823
+ /**
1824
+ * The target never goes above this on an increase, or below it on a decrease.
1825
+ */
1826
+ limit?: number;
1827
+ /**
1828
+ * 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.
1829
+ */
1830
+ maxChangesPerDay?: number;
1831
+ /**
1832
+ * At most this many changes to one object by this rule, counted over the last 400 days. An object at the limit is left alone like one in cooldown.
1833
+ */
1834
+ maxChangesPerObject?: number;
1835
+ } | {
1836
+ /**
1837
+ * Move daily budget from the matched objects ranked worst by `metric` to those ranked best, keeping the total the same. Campaign or ad set rules where the budget sits at that level: objects whose budget sits at another level (Meta CBO and ad set budgets), Google shared budgets and lifetime budgets are left out. Changes are reserved all at once: when `maxChangesPerDay` would hold back any of them, none is made. A receiver is raised only after every giver's cut applied (else it fails with `reallocation_incomplete` and the move is tried again next run). Amounts move in the currency's smallest unit (whole units for JPY or KRW). Counts as raising live spend for the free ads allowance. Not with `lifecycle` or `groups`.
1838
+ */
1839
+ type: 'reallocate_budget';
1840
+ /**
1841
+ * What objects are ranked by: any condition metric except `day_of_month` and `working_day_of_month`, or a result metric (`result:<key>`) on campaign rules. Objects without a value are not ranked, except one that spent with no result on a metric where lower is best (a CPA with no conversions): it ranks worst and only gives.
1842
+ */
1843
+ metric: string;
1844
+ /**
1845
+ * The period the metric is read over, like a condition window.
1846
+ */
1847
+ window: string;
1848
+ /**
1849
+ * Which end of the ranking is best. Defaults to `lowest` for `cpa`, `cpc`, `cpm`, `frequency` and result metrics whose formula has spend above the line (cost per sale, %CAC), `highest` otherwise.
1850
+ */
1851
+ best?: 'highest' | 'lowest';
1852
+ /**
1853
+ * How many of the worst-ranked objects give budget.
1854
+ */
1855
+ from: {
1856
+ count: number;
1857
+ };
1858
+ /**
1859
+ * How many of the best-ranked objects receive it. With fewer ranked objects than `from` plus `to`, givers take at most half and no object is on both sides.
1860
+ */
1861
+ to: {
1862
+ count: number;
1863
+ };
1864
+ /**
1865
+ * The share of each giver's daily budget it gives.
1866
+ */
1867
+ percent?: number;
1868
+ /**
1869
+ * The total to move each run, in the ad account currency, taken evenly from the givers.
1870
+ */
1871
+ amount?: number;
1872
+ /**
1873
+ * A giver never goes below this daily budget. A giver also always keeps a tenth of its budget.
1874
+ */
1875
+ minBudget?: number;
1876
+ /**
1877
+ * A receiver never goes above this daily budget; what receivers cannot take stays with the givers.
1878
+ */
1879
+ maxBudget?: number;
1880
+ /**
1881
+ * 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.
1882
+ */
1883
+ maxChangesPerDay?: number;
1884
+ /**
1885
+ * At most this many changes to one object by this rule, counted over the last 400 days. An object at the limit is left alone like one in cooldown.
1886
+ */
1887
+ maxChangesPerObject?: number;
1888
+ } | {
1889
+ /**
1890
+ * Tag the object by its name. Meta, TikTok and Reddit campaigns, ad sets and ads, and Google, LinkedIn and Pinterest campaigns and ad sets. An object whose name already has the tag (or lacks it, for `remove`) is skipped with `name_unchanged`.
1808
1891
  */
1809
1892
  type: 'edit_name';
1810
1893
  /**
@@ -1875,13 +1958,23 @@ export type type2 = 'notify';
1875
1958
 
1876
1959
  export type direction = 'increase' | 'decrease';
1877
1960
 
1961
+ /**
1962
+ * Which target moves: `cpa` in the ad account currency, `roas` as a ratio (3 is 300%).
1963
+ */
1964
+ export type target = 'cpa' | 'roas';
1965
+
1966
+ /**
1967
+ * Which end of the ranking is best. Defaults to `lowest` for `cpa`, `cpc`, `cpm`, `frequency` and result metrics whose formula has spend above the line (cost per sale, %CAC), `highest` otherwise.
1968
+ */
1969
+ export type best = 'highest' | 'lowest';
1970
+
1878
1971
  /**
1879
1972
  * Where `add` goes. Defaults to `start`.
1880
1973
  */
1881
1974
  export type at = 'start' | 'end';
1882
1975
 
1883
1976
  /**
1884
- * Each type at most once, and at most one of `pause`, `activate`, `adjust_budget`, `adjust_bid`, `duplicate` and `edit_name`.
1977
+ * Each type at most once, and at most one of `pause`, `activate`, `adjust_budget`, `adjust_bid`, `adjust_target`, `reallocate_budget`, `duplicate` and `edit_name`.
1885
1978
  */
1886
1979
  export type AdRuleActions = Array<AdRuleAction>;
1887
1980
 
@@ -1911,7 +2004,7 @@ export type AdRuleActivityEntry = {
1911
2004
  * Its name when the rule acted.
1912
2005
  */
1913
2006
  objectName: (string) | null;
1914
- type: 'pause' | 'activate' | 'adjust_budget' | 'adjust_bid' | 'duplicate' | 'edit_name';
2007
+ type: 'pause' | 'activate' | 'adjust_budget' | 'adjust_bid' | 'adjust_target' | 'reallocate_budget' | 'duplicate' | 'edit_name';
1915
2008
  status: 'done' | 'skipped' | 'failed';
1916
2009
  /**
1917
2010
  * Why it was skipped or failed, for example `already_paused`.
@@ -1935,15 +2028,32 @@ export type AdRuleActivityEntry = {
1935
2028
  * The cap an applied `adjust_bid` set.
1936
2029
  */
1937
2030
  newBidAmount: (number) | null;
2031
+ /**
2032
+ * Which target an `adjust_target` moved.
2033
+ */
2034
+ targetMetric: ('cpa' | 'roas') | null;
2035
+ /**
2036
+ * The target CPA or target ROAS before an `adjust_target`.
2037
+ */
2038
+ previousTarget: (number) | null;
2039
+ /**
2040
+ * The target an applied `adjust_target` set.
2041
+ */
2042
+ newTarget: (number) | null;
1938
2043
  currency: (string) | null;
1939
2044
  };
1940
2045
 
1941
2046
  export type level = 'campaign' | 'adset';
1942
2047
 
1943
- export type type3 = 'pause' | 'activate' | 'adjust_budget' | 'adjust_bid' | 'duplicate' | 'edit_name';
2048
+ export type type3 = 'pause' | 'activate' | 'adjust_budget' | 'adjust_bid' | 'adjust_target' | 'reallocate_budget' | 'duplicate' | 'edit_name';
1944
2049
 
1945
2050
  export type status3 = 'done' | 'skipped' | 'failed';
1946
2051
 
2052
+ /**
2053
+ * Which target an `adjust_target` moved.
2054
+ */
2055
+ export type targetMetric = 'cpa' | 'roas';
2056
+
1947
2057
  export type AdRuleCondition = {
1948
2058
  /**
1949
2059
  * `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.
@@ -2168,7 +2278,7 @@ export type AdRuleRun = {
2168
2278
  matched?: Array<AdRuleObjectEvaluation>;
2169
2279
  actions?: Array<{
2170
2280
  objectId: string;
2171
- type: 'pause' | 'activate' | 'adjust_budget' | 'adjust_bid' | 'duplicate' | 'edit_name';
2281
+ type: 'pause' | 'activate' | 'adjust_budget' | 'adjust_bid' | 'adjust_target' | 'reallocate_budget' | 'duplicate' | 'edit_name';
2172
2282
  status: 'done' | 'skipped' | 'failed';
2173
2283
  /**
2174
2284
  * Why it was skipped or failed, for example `already_paused`.
@@ -2180,6 +2290,9 @@ export type AdRuleRun = {
2180
2290
  newName?: string;
2181
2291
  previousBidAmount?: number;
2182
2292
  newBidAmount?: number;
2293
+ targetMetric?: 'cpa' | 'roas';
2294
+ previousTarget?: number;
2295
+ newTarget?: number;
2183
2296
  }>;
2184
2297
  /**
2185
2298
  * Set when a run of a rule with a `notify` action matched objects and tried to send the webhook. A notify-only rule whose webhook fails ends with outcome `failed`.
@@ -18094,7 +18207,7 @@ export type WebhookPayloadAdRuleTriggered = {
18094
18207
  * What the rule did to the object. Empty on a rule that only notifies.
18095
18208
  */
18096
18209
  actions: Array<{
18097
- type: 'pause' | 'activate' | 'adjust_budget' | 'adjust_bid' | 'duplicate' | 'edit_name';
18210
+ type: 'pause' | 'activate' | 'adjust_budget' | 'adjust_bid' | 'adjust_target' | 'reallocate_budget' | 'duplicate' | 'edit_name';
18098
18211
  /**
18099
18212
  * Action result.
18100
18213
  *
@@ -18103,7 +18216,7 @@ export type WebhookPayloadAdRuleTriggered = {
18103
18216
  */
18104
18217
  status: 'done' | 'skipped' | 'failed';
18105
18218
  /**
18106
- * 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.
18219
+ * 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), `budget_shared`, `reallocation_incomplete` (failed: a receiver left alone because a giver's cut did not apply, tried again next run), `portfolio_bid_strategy`, `unsupported_bid_strategy`, `no_target_cpa`, `no_target_roas`, or the platform's message. Null when done.
18107
18220
  */
18108
18221
  reason: (string) | null;
18109
18222
  /**
@@ -18130,6 +18243,18 @@ export type WebhookPayloadAdRuleTriggered = {
18130
18243
  * On `adjust_bid`, the cap after the change. Null when nothing changed.
18131
18244
  */
18132
18245
  newBidAmount: (number) | null;
18246
+ /**
18247
+ * On `adjust_target`, which target moved. Null otherwise.
18248
+ */
18249
+ targetMetric: ('cpa' | 'roas') | null;
18250
+ /**
18251
+ * On `adjust_target`, the target before the change. Null otherwise.
18252
+ */
18253
+ previousTarget: (number) | null;
18254
+ /**
18255
+ * On `adjust_target`, the target after the change. Null when nothing changed.
18256
+ */
18257
+ newTarget: (number) | null;
18133
18258
  }>;
18134
18259
  }>;
18135
18260
  /**
@@ -52559,7 +52684,7 @@ export type ListAdRuleActivityData = {
52559
52684
  * ISO 8601 date-time, inclusive.
52560
52685
  */
52561
52686
  to?: string;
52562
- type?: 'pause' | 'activate' | 'adjust_budget' | 'adjust_bid' | 'duplicate' | 'edit_name';
52687
+ type?: 'pause' | 'activate' | 'adjust_budget' | 'adjust_bid' | 'adjust_target' | 'reallocate_budget' | 'duplicate' | 'edit_name';
52563
52688
  };
52564
52689
  };
52565
52690