@zernio/node 0.2.1482 → 0.2.1484
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.d.mts +71 -17
- package/dist/index.d.ts +71 -17
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/generated/sdk.gen.ts +5 -1
- package/src/generated/types.gen.ts +71 -16
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.
|
|
39
|
+
version: "0.2.1484",
|
|
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.
|
|
8
|
+
version: "0.2.1484",
|
|
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
package/src/generated/sdk.gen.ts
CHANGED
|
@@ -2292,7 +2292,11 @@ export const moveAccountToProfile = <ThrowOnError extends boolean = false>(optio
|
|
|
2292
2292
|
|
|
2293
2293
|
/**
|
|
2294
2294
|
* Disconnect account
|
|
2295
|
-
* Disconnects and removes a connected account
|
|
2295
|
+
* Disconnects and removes a connected account, and fires account.disconnected with disconnectionType intentional.
|
|
2296
|
+
*
|
|
2297
|
+
* The account is kept for a 1h grace window. Reconnecting the same account within it restores it with the same accountId and its scheduled posts. After that it is deleted permanently.
|
|
2298
|
+
*
|
|
2299
|
+
* Repeating the call for an account already disconnected returns 404, the account stays in its 1h grace window and the disconnect is not re-run.
|
|
2296
2300
|
*/
|
|
2297
2301
|
export const deleteAccount = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteAccountData, ThrowOnError>) => {
|
|
2298
2302
|
return (options?.client ?? client).delete<DeleteAccountResponse, DeleteAccountError, ThrowOnError>({
|
|
@@ -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`
|
|
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
|
|
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.
|
|
@@ -4454,10 +4500,6 @@ export type CallRecord = {
|
|
|
4454
4500
|
*/
|
|
4455
4501
|
metaCostUSD?: number;
|
|
4456
4502
|
telnyxCostUSD?: number;
|
|
4457
|
-
/**
|
|
4458
|
-
* Seconds of the call that were recorded and billed as recording.
|
|
4459
|
-
*/
|
|
4460
|
-
recordingSeconds?: number;
|
|
4461
4503
|
recordingCostUSD?: number;
|
|
4462
4504
|
/**
|
|
4463
4505
|
* Amount Zernio bills you = telephony leg + recording + transcription (excludes any Meta portion).
|
|
@@ -13603,6 +13645,10 @@ export type Post = {
|
|
|
13603
13645
|
* Queue ID if the post was scheduled via a specific queue
|
|
13604
13646
|
*/
|
|
13605
13647
|
queueId?: string;
|
|
13648
|
+
/**
|
|
13649
|
+
* Profile the post is filed under. Set only on drafts that have no platforms.
|
|
13650
|
+
*/
|
|
13651
|
+
profileId?: string;
|
|
13606
13652
|
createdAt?: string;
|
|
13607
13653
|
/**
|
|
13608
13654
|
* Last change to the post or to any of its platforms (a publish, a failure, a resolved URL).
|
|
@@ -17474,7 +17520,9 @@ export type WebhookPayloadAccountDisconnected = {
|
|
|
17474
17520
|
username: string;
|
|
17475
17521
|
displayName?: string;
|
|
17476
17522
|
/**
|
|
17477
|
-
*
|
|
17523
|
+
* intentional: removed on purpose, for example with DELETE /v1/accounts/{accountId} or by a switch to the Free plan for the accounts over its limit. The account is deleted permanently 1 hour later unless the same account is reconnected within that hour.
|
|
17524
|
+
*
|
|
17525
|
+
* unintentional: the connection broke (token expired or revoked, access lost on the platform). The account stays in Zernio, inactive, until it is reconnected (keeping its accountId) or removed.
|
|
17478
17526
|
*/
|
|
17479
17527
|
disconnectionType: 'intentional' | 'unintentional';
|
|
17480
17528
|
/**
|
|
@@ -17491,7 +17539,9 @@ export type WebhookPayloadAccountDisconnected = {
|
|
|
17491
17539
|
export type event5 = 'account.disconnected';
|
|
17492
17540
|
|
|
17493
17541
|
/**
|
|
17494
|
-
*
|
|
17542
|
+
* intentional: removed on purpose, for example with DELETE /v1/accounts/{accountId} or by a switch to the Free plan for the accounts over its limit. The account is deleted permanently 1 hour later unless the same account is reconnected within that hour.
|
|
17543
|
+
*
|
|
17544
|
+
* unintentional: the connection broke (token expired or revoked, access lost on the platform). The account stays in Zernio, inactive, until it is reconnected (keeping its accountId) or removed.
|
|
17495
17545
|
*/
|
|
17496
17546
|
export type disconnectionType = 'intentional' | 'unintentional';
|
|
17497
17547
|
|
|
@@ -17905,7 +17955,7 @@ export type WebhookPayloadAdRuleTriggered = {
|
|
|
17905
17955
|
*/
|
|
17906
17956
|
metric: string;
|
|
17907
17957
|
/**
|
|
17908
|
-
* `today`, `yesterday`, `last_3d`, `last_7d`, `last_14d
|
|
17958
|
+
* `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.
|
|
17909
17959
|
*/
|
|
17910
17960
|
window: string;
|
|
17911
17961
|
/**
|
|
@@ -26899,7 +26949,7 @@ export type ListPostsData = {
|
|
|
26899
26949
|
page?: number;
|
|
26900
26950
|
platform?: string;
|
|
26901
26951
|
/**
|
|
26902
|
-
* Filter posts to a specific profile (24-char hex ObjectId). Omit it, or send `all` or an empty value, to list posts across every profile.
|
|
26952
|
+
* Filter posts to a specific profile (24-char hex ObjectId), including drafts filed under it without platforms. Omit it, or send `all` or an empty value, to list posts across every profile.
|
|
26903
26953
|
*/
|
|
26904
26954
|
profileId?: string;
|
|
26905
26955
|
/**
|
|
@@ -27065,6 +27115,10 @@ export type CreatePostData = {
|
|
|
27065
27115
|
*
|
|
27066
27116
|
*/
|
|
27067
27117
|
queueId?: string;
|
|
27118
|
+
/**
|
|
27119
|
+
* Files a draft with no platforms under this profile so it lists under ?profileId= and profile-scoped API keys. Ignored when platforms are set. When promoting the draft via PUT, send platforms, isDraft false and scheduledFor again.
|
|
27120
|
+
*/
|
|
27121
|
+
profileId?: string;
|
|
27068
27122
|
};
|
|
27069
27123
|
headers?: {
|
|
27070
27124
|
/**
|
|
@@ -41844,10 +41898,6 @@ export type ListWhatsAppCallsResponse = ({
|
|
|
41844
41898
|
*/
|
|
41845
41899
|
metaCostUSD?: number;
|
|
41846
41900
|
telnyxCostUSD?: number;
|
|
41847
|
-
/**
|
|
41848
|
-
* Seconds of the call that were recorded and billed as recording.
|
|
41849
|
-
*/
|
|
41850
|
-
recordingSeconds?: number;
|
|
41851
41901
|
recordingCostUSD?: number;
|
|
41852
41902
|
/**
|
|
41853
41903
|
* Amount Zernio bills you = Telnyx leg + recording (excludes Meta).
|
|
@@ -51698,6 +51748,7 @@ export type CreateAdRuleData = {
|
|
|
51698
51748
|
*/
|
|
51699
51749
|
campaignIds?: Array<(string)>;
|
|
51700
51750
|
filters?: AdRuleFilters;
|
|
51751
|
+
groups?: AdRuleGroups;
|
|
51701
51752
|
lifecycle?: AdRuleLifecycle;
|
|
51702
51753
|
conditions: AdRuleConditions;
|
|
51703
51754
|
actions: AdRuleActions;
|
|
@@ -51815,6 +51866,10 @@ export type UpdateAdRuleData = {
|
|
|
51815
51866
|
level?: AdRuleLevel;
|
|
51816
51867
|
campaignIds?: Array<(string)> | null;
|
|
51817
51868
|
filters?: AdRuleFilters;
|
|
51869
|
+
/**
|
|
51870
|
+
* Null removes the groups; each campaign is then judged on its own.
|
|
51871
|
+
*/
|
|
51872
|
+
groups?: (AdRuleGroups);
|
|
51818
51873
|
/**
|
|
51819
51874
|
* Null removes it; every matching run then acts and notifies again.
|
|
51820
51875
|
*/
|