@zernio/node 0.2.1825 → 0.2.1827

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 CHANGED
@@ -23980,13 +23980,17 @@ type StagedAdChange = {
23980
23980
  * The object the change applies to: the platform campaign id, the platform ad set id, or the Zernio ad id. Null for a create, whose object does not exist yet.
23981
23981
  */
23982
23982
  targetId: (string) | null;
23983
+ /**
23984
+ * The name of the object when the change was staged, or the name a create will give it. Null when it is not known.
23985
+ */
23986
+ targetName?: (string) | null;
23983
23987
  /**
23984
23988
  * Present and true when the change creates a new object. Every diff entry then has `before: null` and `beforeAvailable: false`.
23985
23989
  */
23986
23990
  creates?: boolean;
23987
23991
  /**
23988
23992
  * - `staged`: waiting to be confirmed or discarded.
23989
- * - `confirming`: a confirm is running. A change that stays here has an unknown outcome and is never applied again automatically.
23993
+ * - `confirming`: a confirm is running. A change left here for 15 minutes ends as `failed` with error code `change_outcome_unknown`, and is never applied again automatically.
23990
23994
  * - `confirmed`: applied. `result` holds what the write returned.
23991
23995
  * - `failed`: not applied. `error` says why.
23992
23996
  *
@@ -24031,9 +24035,17 @@ type StagedAdChange = {
24031
24035
  * The user who staged the change.
24032
24036
  */
24033
24037
  createdBy: string;
24038
+ /**
24039
+ * The user who confirmed the change. Null while nobody has, and after a confirm that left the change staged.
24040
+ */
24041
+ confirmedBy?: (string) | null;
24042
+ /**
24043
+ * Present and true on a staged change whose last confirm was refused with `change_target_changed`. `error` then says why. Discard it and stage it again from the current values.
24044
+ */
24045
+ stale?: boolean;
24034
24046
  createdAt: string;
24035
24047
  /**
24036
- * When the confirm ended, as `confirmed` or `failed`. A finished change is deleted 7 days later.
24048
+ * When the confirm ended, as `confirmed` or `failed`. A finished change is deleted 7 days later, a failed create 30 days later.
24037
24049
  */
24038
24050
  finishedAt: (string) | null;
24039
24051
  /**
@@ -24043,7 +24055,7 @@ type StagedAdChange = {
24043
24055
  [key: string]: unknown;
24044
24056
  };
24045
24057
  /**
24046
- * Present once `failed`.
24058
+ * Present once `failed`, and on a staged change marked `stale`.
24047
24059
  */
24048
24060
  error?: {
24049
24061
  /**
@@ -24065,7 +24077,7 @@ type StagedAdChange = {
24065
24077
  type type32 = 'campaign_status' | 'ad_set_status' | 'ad_status' | 'campaign_update' | 'ad_set_update' | 'ad_update' | 'campaign_targeting' | 'ad_create' | 'campaign_create' | 'ad_set_create';
24066
24078
  /**
24067
24079
  * - `staged`: waiting to be confirmed or discarded.
24068
- * - `confirming`: a confirm is running. A change that stays here has an unknown outcome and is never applied again automatically.
24080
+ * - `confirming`: a confirm is running. A change left here for 15 minutes ends as `failed` with error code `change_outcome_unknown`, and is never applied again automatically.
24069
24081
  * - `confirmed`: applied. `result` holds what the write returned.
24070
24082
  * - `failed`: not applied. `error` says why.
24071
24083
  *
package/dist/index.d.ts CHANGED
@@ -23980,13 +23980,17 @@ type StagedAdChange = {
23980
23980
  * The object the change applies to: the platform campaign id, the platform ad set id, or the Zernio ad id. Null for a create, whose object does not exist yet.
23981
23981
  */
23982
23982
  targetId: (string) | null;
23983
+ /**
23984
+ * The name of the object when the change was staged, or the name a create will give it. Null when it is not known.
23985
+ */
23986
+ targetName?: (string) | null;
23983
23987
  /**
23984
23988
  * Present and true when the change creates a new object. Every diff entry then has `before: null` and `beforeAvailable: false`.
23985
23989
  */
23986
23990
  creates?: boolean;
23987
23991
  /**
23988
23992
  * - `staged`: waiting to be confirmed or discarded.
23989
- * - `confirming`: a confirm is running. A change that stays here has an unknown outcome and is never applied again automatically.
23993
+ * - `confirming`: a confirm is running. A change left here for 15 minutes ends as `failed` with error code `change_outcome_unknown`, and is never applied again automatically.
23990
23994
  * - `confirmed`: applied. `result` holds what the write returned.
23991
23995
  * - `failed`: not applied. `error` says why.
23992
23996
  *
@@ -24031,9 +24035,17 @@ type StagedAdChange = {
24031
24035
  * The user who staged the change.
24032
24036
  */
24033
24037
  createdBy: string;
24038
+ /**
24039
+ * The user who confirmed the change. Null while nobody has, and after a confirm that left the change staged.
24040
+ */
24041
+ confirmedBy?: (string) | null;
24042
+ /**
24043
+ * Present and true on a staged change whose last confirm was refused with `change_target_changed`. `error` then says why. Discard it and stage it again from the current values.
24044
+ */
24045
+ stale?: boolean;
24034
24046
  createdAt: string;
24035
24047
  /**
24036
- * When the confirm ended, as `confirmed` or `failed`. A finished change is deleted 7 days later.
24048
+ * When the confirm ended, as `confirmed` or `failed`. A finished change is deleted 7 days later, a failed create 30 days later.
24037
24049
  */
24038
24050
  finishedAt: (string) | null;
24039
24051
  /**
@@ -24043,7 +24055,7 @@ type StagedAdChange = {
24043
24055
  [key: string]: unknown;
24044
24056
  };
24045
24057
  /**
24046
- * Present once `failed`.
24058
+ * Present once `failed`, and on a staged change marked `stale`.
24047
24059
  */
24048
24060
  error?: {
24049
24061
  /**
@@ -24065,7 +24077,7 @@ type StagedAdChange = {
24065
24077
  type type32 = 'campaign_status' | 'ad_set_status' | 'ad_status' | 'campaign_update' | 'ad_set_update' | 'ad_update' | 'campaign_targeting' | 'ad_create' | 'campaign_create' | 'ad_set_create';
24066
24078
  /**
24067
24079
  * - `staged`: waiting to be confirmed or discarded.
24068
- * - `confirming`: a confirm is running. A change that stays here has an unknown outcome and is never applied again automatically.
24080
+ * - `confirming`: a confirm is running. A change left here for 15 minutes ends as `failed` with error code `change_outcome_unknown`, and is never applied again automatically.
24069
24081
  * - `confirmed`: applied. `result` holds what the write returned.
24070
24082
  * - `failed`: not applied. `error` says why.
24071
24083
  *
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.1825",
39
+ version: "0.2.1827",
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.1825",
8
+ version: "0.2.1827",
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.1825",
3
+ "version": "0.2.1827",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -15520,7 +15520,7 @@ export const listAdChanges = <ThrowOnError extends boolean = false>(options?: Op
15520
15520
  * Get a staged ad change
15521
15521
  * Returns one ad change with its before/after diff. A change is created by sending a supported ad write with `stage: true`.
15522
15522
  *
15523
- * A staged change does not expire. A confirmed or failed change stays readable for 7 days.
15523
+ * A staged change does not expire. A confirmed or failed change stays readable for 7 days, a failed create for 30 days. Disconnecting the connection of a staged change deletes it.
15524
15524
  *
15525
15525
  */
15526
15526
  export const getAdChange = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetAdChangeData, ThrowOnError>) => {
@@ -15554,7 +15554,9 @@ export const discardAdChange = <ThrowOnError extends boolean = false>(options: O
15554
15554
  *
15555
15555
  * Before writing, the object is read from the ad network again and compared with what it held when the change was staged.
15556
15556
  *
15557
- * If it changed in between, nothing is written, the change ends as `failed` and the answer is `409` `change_target_changed` with the current values in `details.current`. Stage the change again from those values.
15557
+ * If it changed in between, nothing is written and the answer is `409` `change_target_changed` with the current values in `details.current`. The change stays `staged` and reads `stale: true`. Discard it and stage the change again from those values.
15558
+ *
15559
+ * After a confirm, the other staged changes on the same object are read again, so confirming one of two changes on an object does not refuse the other.
15558
15560
  *
15559
15561
  * ### Retrying
15560
15562
  *
@@ -19465,8 +19467,9 @@ export const getAdAccountFinance = <ThrowOnError extends boolean = false>(option
19465
19467
  *
19466
19468
  * - `ready` is `false` when a create or boost would be refused. `blockers` lists why, each with the `code` a refused create returns (`ad_account_unusable`, `ad_account_payment_required`, `linked_account_required`, `meta_security_check_required`, `ad_account_policy_not_accepted`, ...), a `hint` and a `fix` link.
19467
19469
  * - `status` is `blocked` when any check is `error`, `attention` when one is `warning`, else `ok`. It also counts problems that stop delivery but not a create, such as a reached spending limit, so `status` can be `blocked` while `ready` is `true`.
19468
- * - A check that is not `ok` carries the `code` of the create refusal it explains, when there is one: `whatsapp` (`missing`) carries `whatsapp_number_not_linked` and `lead_terms` (`missing`) carries `lead_ads_terms_not_accepted`, which only click-to-WhatsApp ads and lead ads hit.
19469
- * - `missing` marks an optional asset that is not set up (a pixel, a WhatsApp number): only the ads that need it are affected.
19470
+ * - A check that is not `ok` carries the `code` of the create refusal it explains, when there is one: `lead_terms` (`missing`) carries `lead_ads_terms_not_accepted`, which only lead ads hit.
19471
+ * - `missing` marks an optional asset that is not set up (a pixel): only the ads that need it are affected.
19472
+ * - `whatsapp` is `ok` with the number when Meta returns it, else `unknown`: Meta does not share a Page's WhatsApp number with every app, so an empty field is not proof that no number is linked.
19470
19473
  * - An unsettled balance (`account_status` 3) is a `warning`: Meta still accepts creates on it while a payment method is set.
19471
19474
  * - A `fix.url` is either a Meta page or a Zernio dashboard path (starting with `/`).
19472
19475
  *
@@ -22303,13 +22303,17 @@ export type StagedAdChange = {
22303
22303
  * The object the change applies to: the platform campaign id, the platform ad set id, or the Zernio ad id. Null for a create, whose object does not exist yet.
22304
22304
  */
22305
22305
  targetId: (string) | null;
22306
+ /**
22307
+ * The name of the object when the change was staged, or the name a create will give it. Null when it is not known.
22308
+ */
22309
+ targetName?: (string) | null;
22306
22310
  /**
22307
22311
  * Present and true when the change creates a new object. Every diff entry then has `before: null` and `beforeAvailable: false`.
22308
22312
  */
22309
22313
  creates?: boolean;
22310
22314
  /**
22311
22315
  * - `staged`: waiting to be confirmed or discarded.
22312
- * - `confirming`: a confirm is running. A change that stays here has an unknown outcome and is never applied again automatically.
22316
+ * - `confirming`: a confirm is running. A change left here for 15 minutes ends as `failed` with error code `change_outcome_unknown`, and is never applied again automatically.
22313
22317
  * - `confirmed`: applied. `result` holds what the write returned.
22314
22318
  * - `failed`: not applied. `error` says why.
22315
22319
  *
@@ -22354,9 +22358,17 @@ export type StagedAdChange = {
22354
22358
  * The user who staged the change.
22355
22359
  */
22356
22360
  createdBy: string;
22361
+ /**
22362
+ * The user who confirmed the change. Null while nobody has, and after a confirm that left the change staged.
22363
+ */
22364
+ confirmedBy?: (string) | null;
22365
+ /**
22366
+ * Present and true on a staged change whose last confirm was refused with `change_target_changed`. `error` then says why. Discard it and stage it again from the current values.
22367
+ */
22368
+ stale?: boolean;
22357
22369
  createdAt: string;
22358
22370
  /**
22359
- * When the confirm ended, as `confirmed` or `failed`. A finished change is deleted 7 days later.
22371
+ * When the confirm ended, as `confirmed` or `failed`. A finished change is deleted 7 days later, a failed create 30 days later.
22360
22372
  */
22361
22373
  finishedAt: (string) | null;
22362
22374
  /**
@@ -22366,7 +22378,7 @@ export type StagedAdChange = {
22366
22378
  [key: string]: unknown;
22367
22379
  };
22368
22380
  /**
22369
- * Present once `failed`.
22381
+ * Present once `failed`, and on a staged change marked `stale`.
22370
22382
  */
22371
22383
  error?: {
22372
22384
  /**
@@ -22390,7 +22402,7 @@ export type type32 = 'campaign_status' | 'ad_set_status' | 'ad_status' | 'campai
22390
22402
 
22391
22403
  /**
22392
22404
  * - `staged`: waiting to be confirmed or discarded.
22393
- * - `confirming`: a confirm is running. A change that stays here has an unknown outcome and is never applied again automatically.
22405
+ * - `confirming`: a confirm is running. A change left here for 15 minutes ends as `failed` with error code `change_outcome_unknown`, and is never applied again automatically.
22394
22406
  * - `confirmed`: applied. `result` holds what the write returned.
22395
22407
  * - `failed`: not applied. `error` says why.
22396
22408
  *