@zernio/node 0.2.1481 → 0.2.1483

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.1481",
39
+ version: "0.2.1483",
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.1481",
8
+ version: "0.2.1483",
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.1481",
3
+ "version": "0.2.1483",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -1676,6 +1676,7 @@ export type AdRule = {
1676
1676
  */
1677
1677
  campaignIds: Array<(string)> | null;
1678
1678
  filters: AdRuleFilters;
1679
+ groups: AdRuleGroups;
1679
1680
  /**
1680
1681
  * Null when every matching run acts and notifies.
1681
1682
  */
@@ -1951,24 +1952,30 @@ export type AdRuleCondition = {
1951
1952
  *
1952
1953
  * Both read campaigns and ad sets with a daily budget of their own. A lifetime budget never matches.
1953
1954
  *
1955
+ * `day_of_month` and `working_day_of_month` read today's date in the ad account's timezone, the same for every object: `working_day_of_month` `>=` 5 holds from the fifth weekday of the month (Monday to Friday, holidays not counted). They take `window: today`, no `compareTo` and no `top` or `bottom`.
1956
+ *
1954
1957
  * `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.
1955
1958
  *
1956
1959
  */
1957
- metric: ('spend' | 'impressions' | 'clicks' | 'conversions' | 'ctr' | 'cpc' | 'cpm' | 'cpa' | 'roas' | 'reach' | 'frequency' | 'daily_budget' | 'budget_used' | unknown);
1960
+ metric: ('spend' | 'impressions' | 'clicks' | 'conversions' | 'ctr' | 'cpc' | 'cpm' | 'cpa' | 'roas' | 'reach' | 'frequency' | 'daily_budget' | 'budget_used' | 'day_of_month' | 'working_day_of_month' | unknown);
1958
1961
  /**
1959
- * Days in the ad account's own timezone. `last_7d` is the 7 full days before today; only `today` reads the day in progress.
1962
+ * Days in the ad account's own timezone. `last_7d` is the 7 full days before today; only `today` and `this_month` read the day in progress.
1963
+ *
1964
+ * `this_month` runs from the 1st through today; `last_month` is the whole previous calendar month.
1960
1965
  *
1961
1966
  * `<from>_to_<to>_days_ago` is any range of full days, both ends included, such as `8_to_2_days_ago` to skip the 2 most recent days while their conversions still arrive. `from` is at least `to` and at most 90.
1962
1967
  *
1963
1968
  */
1964
- window: ('today' | 'yesterday' | 'last_3d' | 'last_7d' | 'last_14d' | 'last_30d' | unknown);
1969
+ window: ('today' | 'yesterday' | 'last_3d' | 'last_7d' | 'last_14d' | 'last_30d' | 'this_month' | 'last_month' | unknown);
1965
1970
  /**
1966
1971
  * `top` and `bottom` rank the rule's objects by the metric over the window, highest first for `top`, and match the first `value` (a whole number from 1 to 100). Objects with no value are not ranked; the run history shows each one's position.
1967
1972
  */
1968
1973
  op: '>' | '>=' | '<' | '<=' | 'top' | 'bottom';
1969
1974
  value: number;
1970
1975
  /**
1971
- * Makes the condition relative: `value` becomes a ratio of the metric over `window` to the same metric over this window. `previous_period` is the same number of days just before `window`; any other value is a window, such as `30_to_2_days_ago`.
1976
+ * Makes the condition relative: `value` becomes a ratio of the metric over `window` to the same metric over this window, such as `30_to_2_days_ago`.
1977
+ *
1978
+ * `previous_period` is the same number of days just before `window`. For `this_month` it is the same days of last month, and for `last_month` the month before.
1972
1979
  *
1973
1980
  * Spend, impressions, clicks, conversions and reach are compared per day, so windows of different lengths compare fairly; rates such as `cpc` compare as they are. A comparison window with no value never matches.
1974
1981
  *
@@ -2016,6 +2023,23 @@ export type AdRuleEvaluation = {
2016
2023
  * Every delivering campaign or ad set in scope (for an `activate` rule, the rule-paused ones it may reactivate).
2017
2024
  */
2018
2025
  objects: Array<AdRuleObjectEvaluation>;
2026
+ /**
2027
+ * Each group's totals, for a rule with groups. Null otherwise.
2028
+ */
2029
+ groups?: Array<{
2030
+ name: string;
2031
+ matched: boolean;
2032
+ /**
2033
+ * Like an object's conditions, read on the group's totals.
2034
+ */
2035
+ conditions: Array<{
2036
+ [key: string]: unknown;
2037
+ }>;
2038
+ /**
2039
+ * Every campaign counted in the group, paused ones included.
2040
+ */
2041
+ campaignIds: Array<(string)>;
2042
+ }> | null;
2019
2043
  };
2020
2044
 
2021
2045
  /**
@@ -2042,6 +2066,24 @@ export type AdRuleFilters = Array<({
2042
2066
  value: number;
2043
2067
  })>;
2044
2068
 
2069
+ /**
2070
+ * Campaigns judged together, campaign rules only. Each group's numbers and your results are added up across its campaigns, and rates and formulas are computed on the totals: a group's `result:cac_percent` is its total spend over its total revenue.
2071
+ *
2072
+ * 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.
2073
+ *
2074
+ * 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. Reach and frequency cannot be added up across campaigns, so a rule with groups cannot use them.
2075
+ *
2076
+ * 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.
2077
+ *
2078
+ */
2079
+ export type AdRuleGroups = Array<{
2080
+ /**
2081
+ * Unique in the rule, ignoring case.
2082
+ */
2083
+ name: string;
2084
+ filters: AdRuleFilters;
2085
+ }> | null;
2086
+
2045
2087
  /**
2046
2088
  * Whether the rule checks campaigns, ad sets or single ads. Each one is evaluated on its own.
2047
2089
  */
@@ -2076,6 +2118,10 @@ export type AdRuleObjectEvaluation = {
2076
2118
  * True when every condition holds.
2077
2119
  */
2078
2120
  matched: boolean;
2121
+ /**
2122
+ * For a rule with groups: the group this campaign was judged in. `matched` and `conditions` are the group's.
2123
+ */
2124
+ group?: string;
2079
2125
  conditions: Array<(AdRuleCondition & {
2080
2126
  /**
2081
2127
  * The object's value over the window. Null when it cannot be computed.
@@ -17901,7 +17947,7 @@ export type WebhookPayloadAdRuleTriggered = {
17901
17947
  */
17902
17948
  metric: string;
17903
17949
  /**
17904
- * `today`, `yesterday`, `last_3d`, `last_7d`, `last_14d` or `last_30d`, in the account's calendar (see `run.today`). New values may be added.
17950
+ * `today`, `yesterday`, `last_3d`, `last_7d`, `last_14d`, `last_30d`, `this_month`, `last_month` or a custom range, in the account's calendar (see `run.today`). New values may be added.
17905
17951
  */
17906
17952
  window: string;
17907
17953
  /**
@@ -51690,6 +51736,7 @@ export type CreateAdRuleData = {
51690
51736
  */
51691
51737
  campaignIds?: Array<(string)>;
51692
51738
  filters?: AdRuleFilters;
51739
+ groups?: AdRuleGroups;
51693
51740
  lifecycle?: AdRuleLifecycle;
51694
51741
  conditions: AdRuleConditions;
51695
51742
  actions: AdRuleActions;
@@ -51807,6 +51854,10 @@ export type UpdateAdRuleData = {
51807
51854
  level?: AdRuleLevel;
51808
51855
  campaignIds?: Array<(string)> | null;
51809
51856
  filters?: AdRuleFilters;
51857
+ /**
51858
+ * Null removes the groups; each campaign is then judged on its own.
51859
+ */
51860
+ groups?: (AdRuleGroups);
51810
51861
  /**
51811
51862
  * Null removes it; every matching run then acts and notifies again.
51812
51863
  */