@getlatedev/node 0.2.1438 → 0.2.1439

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
@@ -56597,12 +56597,40 @@ type GetAdAccountHealthData = {
56597
56597
  type GetAdAccountHealthResponse = ({
56598
56598
  adAccountId?: string;
56599
56599
  status?: 'ok' | 'attention' | 'blocked';
56600
+ /**
56601
+ * False when a create or boost on this ad account would be refused; `blockers` says why.
56602
+ */
56603
+ ready?: boolean;
56604
+ blockers?: Array<{
56605
+ /**
56606
+ * The `checks[].id` that blocks.
56607
+ */
56608
+ check: string;
56609
+ /**
56610
+ * The error code a refused create or boost returns for this reason.
56611
+ */
56612
+ code: string;
56613
+ message: string;
56614
+ /**
56615
+ * What to do, in English.
56616
+ */
56617
+ hint: string;
56618
+ fix?: {
56619
+ label?: string;
56620
+ url?: string;
56621
+ };
56622
+ }>;
56600
56623
  checkedAt?: string;
56601
56624
  checks?: Array<{
56602
- id: 'account_status' | 'payment' | 'spend_cap' | 'page' | 'instagram' | 'lead_terms' | 'pixel' | 'whatsapp';
56625
+ id: 'account_status' | 'payment' | 'spend_cap' | 'page' | 'instagram' | 'lead_terms' | 'pixel' | 'whatsapp' | 'last_refusal';
56603
56626
  status: 'ok' | 'warning' | 'error' | 'missing' | 'unknown';
56604
56627
  title: string;
56605
56628
  message: string;
56629
+ /**
56630
+ * When the check is not `ok`: the error code a create refused for this reason returns.
56631
+ */
56632
+ code?: string;
56633
+ hint?: string;
56606
56634
  fix?: {
56607
56635
  label?: string;
56608
56636
  url?: string;
@@ -57701,6 +57729,7 @@ type BoostPostData = {
57701
57729
  *
57702
57730
  * - Idempotency-Key storage and the duplicate-boost guard are bypassed.
57703
57731
  * - Counts toward the 30 Meta writes per ad account per 5 minutes.
57732
+ * - Runs the account status and payment checks of GET /v1/ads/accounts/health first: an ad account that is not ready answers its blocker `code` (`ad_account_unusable`, `ad_account_payment_required`) with `details.hint` and `details.fix`, and Meta is not called.
57704
57733
  * - With `adSetId`, only the ad is dry-run.
57705
57734
  * - An Instagram video Meta refuses as a direct reference (subcode 1815279) comes back as `unverified` nodes, because the copy a real boost makes cannot be dry-run.
57706
57735
  *
@@ -58098,6 +58127,8 @@ type CreateStandaloneAdData = {
58098
58127
  *
58099
58128
  * **Meta**: validates the inline campaign, ad set, creative and ad with execution_options validate_only. Nothing is uploaded or created; validation bypasses Idempotency-Key storage. Success returns 200 with per-node results; a Meta rejection returns an error.
58100
58129
  *
58130
+ * Before the dry run, Meta validateOnly runs the account status and payment checks of GET /v1/ads/accounts/health: an ad account that is not ready answers its blocker `code` (`ad_account_unusable`, `ad_account_payment_required`) with `details.hint` and `details.fix`, and Meta is not called.
58131
+ *
58101
58132
  * - Supported: a single image or existing video.id (each also with bodies[] / headlines[] Multiple Text Options), all-image placementAssets with per-rule copy and text pools, or existingCreativeId.
58102
58133
  * - Return 400: dynamicCreative, translations, carouselCards, placement videos, new video uploads, creatives[], adSetId, RESERVED buying.
58103
58134
  * - Placement validation uses existing Instagram identities only. Existing campaign or creative nodes are marked skipped.
package/dist/index.d.ts CHANGED
@@ -56597,12 +56597,40 @@ type GetAdAccountHealthData = {
56597
56597
  type GetAdAccountHealthResponse = ({
56598
56598
  adAccountId?: string;
56599
56599
  status?: 'ok' | 'attention' | 'blocked';
56600
+ /**
56601
+ * False when a create or boost on this ad account would be refused; `blockers` says why.
56602
+ */
56603
+ ready?: boolean;
56604
+ blockers?: Array<{
56605
+ /**
56606
+ * The `checks[].id` that blocks.
56607
+ */
56608
+ check: string;
56609
+ /**
56610
+ * The error code a refused create or boost returns for this reason.
56611
+ */
56612
+ code: string;
56613
+ message: string;
56614
+ /**
56615
+ * What to do, in English.
56616
+ */
56617
+ hint: string;
56618
+ fix?: {
56619
+ label?: string;
56620
+ url?: string;
56621
+ };
56622
+ }>;
56600
56623
  checkedAt?: string;
56601
56624
  checks?: Array<{
56602
- id: 'account_status' | 'payment' | 'spend_cap' | 'page' | 'instagram' | 'lead_terms' | 'pixel' | 'whatsapp';
56625
+ id: 'account_status' | 'payment' | 'spend_cap' | 'page' | 'instagram' | 'lead_terms' | 'pixel' | 'whatsapp' | 'last_refusal';
56603
56626
  status: 'ok' | 'warning' | 'error' | 'missing' | 'unknown';
56604
56627
  title: string;
56605
56628
  message: string;
56629
+ /**
56630
+ * When the check is not `ok`: the error code a create refused for this reason returns.
56631
+ */
56632
+ code?: string;
56633
+ hint?: string;
56606
56634
  fix?: {
56607
56635
  label?: string;
56608
56636
  url?: string;
@@ -57701,6 +57729,7 @@ type BoostPostData = {
57701
57729
  *
57702
57730
  * - Idempotency-Key storage and the duplicate-boost guard are bypassed.
57703
57731
  * - Counts toward the 30 Meta writes per ad account per 5 minutes.
57732
+ * - Runs the account status and payment checks of GET /v1/ads/accounts/health first: an ad account that is not ready answers its blocker `code` (`ad_account_unusable`, `ad_account_payment_required`) with `details.hint` and `details.fix`, and Meta is not called.
57704
57733
  * - With `adSetId`, only the ad is dry-run.
57705
57734
  * - An Instagram video Meta refuses as a direct reference (subcode 1815279) comes back as `unverified` nodes, because the copy a real boost makes cannot be dry-run.
57706
57735
  *
@@ -58098,6 +58127,8 @@ type CreateStandaloneAdData = {
58098
58127
  *
58099
58128
  * **Meta**: validates the inline campaign, ad set, creative and ad with execution_options validate_only. Nothing is uploaded or created; validation bypasses Idempotency-Key storage. Success returns 200 with per-node results; a Meta rejection returns an error.
58100
58129
  *
58130
+ * Before the dry run, Meta validateOnly runs the account status and payment checks of GET /v1/ads/accounts/health: an ad account that is not ready answers its blocker `code` (`ad_account_unusable`, `ad_account_payment_required`) with `details.hint` and `details.fix`, and Meta is not called.
58131
+ *
58101
58132
  * - Supported: a single image or existing video.id (each also with bodies[] / headlines[] Multiple Text Options), all-image placementAssets with per-rule copy and text pools, or existingCreativeId.
58102
58133
  * - Return 400: dynamicCreative, translations, carouselCards, placement videos, new video uploads, creatives[], adSetId, RESERVED buying.
58103
58134
  * - Placement validation uses existing Instagram identities only. Existing campaign or creative nodes are marked skipped.
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: "@getlatedev/node",
39
- version: "0.2.1438",
39
+ version: "0.2.1439",
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: "@getlatedev/node",
8
- version: "0.2.1438",
8
+ version: "0.2.1439",
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": "@getlatedev/node",
3
- "version": "0.2.1438",
3
+ "version": "0.2.1439",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -16040,15 +16040,34 @@ export const getAdAccountFinance = <ThrowOnError extends boolean = false>(option
16040
16040
  * - the Page's Lead Ads terms
16041
16041
  * - the newest pixel event
16042
16042
  * - the WhatsApp number linked to the Page
16043
+ * - the last refusal Meta gave a create or boost for a reason only the account owner can fix (`last_refusal`, see below)
16043
16044
  *
16044
16045
  * Each check reads on its own: one this connection cannot see comes back `unknown` instead of failing the request.
16045
16046
  *
16047
+ * ### Remembered refusals
16048
+ *
16049
+ * Meta cannot be asked about a code 31 security check up front. So `last_refusal` reports the last refusal of this kind that a create or boost met:
16050
+ *
16051
+ * - a code 31 security check or a temporary block, remembered for the connection (`accountId`)
16052
+ * - a payment method, the non-discrimination policy or a disabled account, remembered for the ad account
16053
+ *
16054
+ * It stays until a later create succeeds, or for 7 days (1 day for a temporary block).
16055
+ *
16046
16056
  * ### Reading the result
16047
16057
  *
16048
- * - `status` is `blocked` when any check is `error` (ads will be refused), `attention` when one is `warning`, else `ok`.
16058
+ * - `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.
16059
+ * - `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`.
16060
+ * - 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.
16049
16061
  * - `missing` marks an optional asset that is not set up (a pixel, a WhatsApp number): only the ads that need it are affected.
16062
+ * - An unsettled balance (`account_status` 3) is a `warning`: Meta still accepts creates on it while a payment method is set.
16050
16063
  * - A `fix.url` is either a Meta page or a Zernio dashboard path (starting with `/`).
16051
16064
  *
16065
+ * ### validateOnly
16066
+ *
16067
+ * `POST /v1/ads/create` and `POST /v1/ads/boost` with `validateOnly: true` run the account status and payment checks first. A blocked account answers the same `code` with `details.hint` and `details.fix`, without a Meta dry run (Meta counts dry runs as ad writes).
16068
+ *
16069
+ * They read the account state cached for up to 5 minutes. This endpoint always reads it fresh and refreshes that cache.
16070
+ *
16052
16071
  */
16053
16072
  export const getAdAccountHealth = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetAdAccountHealthData, ThrowOnError>) => {
16054
16073
  return (options?.client ?? client).get<GetAdAccountHealthResponse, GetAdAccountHealthError, ThrowOnError>({
@@ -57746,12 +57746,40 @@ export type GetAdAccountHealthData = {
57746
57746
  export type GetAdAccountHealthResponse = ({
57747
57747
  adAccountId?: string;
57748
57748
  status?: 'ok' | 'attention' | 'blocked';
57749
+ /**
57750
+ * False when a create or boost on this ad account would be refused; `blockers` says why.
57751
+ */
57752
+ ready?: boolean;
57753
+ blockers?: Array<{
57754
+ /**
57755
+ * The `checks[].id` that blocks.
57756
+ */
57757
+ check: string;
57758
+ /**
57759
+ * The error code a refused create or boost returns for this reason.
57760
+ */
57761
+ code: string;
57762
+ message: string;
57763
+ /**
57764
+ * What to do, in English.
57765
+ */
57766
+ hint: string;
57767
+ fix?: {
57768
+ label?: string;
57769
+ url?: string;
57770
+ };
57771
+ }>;
57749
57772
  checkedAt?: string;
57750
57773
  checks?: Array<{
57751
- id: 'account_status' | 'payment' | 'spend_cap' | 'page' | 'instagram' | 'lead_terms' | 'pixel' | 'whatsapp';
57774
+ id: 'account_status' | 'payment' | 'spend_cap' | 'page' | 'instagram' | 'lead_terms' | 'pixel' | 'whatsapp' | 'last_refusal';
57752
57775
  status: 'ok' | 'warning' | 'error' | 'missing' | 'unknown';
57753
57776
  title: string;
57754
57777
  message: string;
57778
+ /**
57779
+ * When the check is not `ok`: the error code a create refused for this reason returns.
57780
+ */
57781
+ code?: string;
57782
+ hint?: string;
57755
57783
  fix?: {
57756
57784
  label?: string;
57757
57785
  url?: string;
@@ -58870,6 +58898,7 @@ export type BoostPostData = {
58870
58898
  *
58871
58899
  * - Idempotency-Key storage and the duplicate-boost guard are bypassed.
58872
58900
  * - Counts toward the 30 Meta writes per ad account per 5 minutes.
58901
+ * - Runs the account status and payment checks of GET /v1/ads/accounts/health first: an ad account that is not ready answers its blocker `code` (`ad_account_unusable`, `ad_account_payment_required`) with `details.hint` and `details.fix`, and Meta is not called.
58873
58902
  * - With `adSetId`, only the ad is dry-run.
58874
58903
  * - An Instagram video Meta refuses as a direct reference (subcode 1815279) comes back as `unverified` nodes, because the copy a real boost makes cannot be dry-run.
58875
58904
  *
@@ -59291,6 +59320,8 @@ export type CreateStandaloneAdData = {
59291
59320
  *
59292
59321
  * **Meta**: validates the inline campaign, ad set, creative and ad with execution_options validate_only. Nothing is uploaded or created; validation bypasses Idempotency-Key storage. Success returns 200 with per-node results; a Meta rejection returns an error.
59293
59322
  *
59323
+ * Before the dry run, Meta validateOnly runs the account status and payment checks of GET /v1/ads/accounts/health: an ad account that is not ready answers its blocker `code` (`ad_account_unusable`, `ad_account_payment_required`) with `details.hint` and `details.fix`, and Meta is not called.
59324
+ *
59294
59325
  * - Supported: a single image or existing video.id (each also with bodies[] / headlines[] Multiple Text Options), all-image placementAssets with per-rule copy and text pools, or existingCreativeId.
59295
59326
  * - Return 400: dynamicCreative, translations, carouselCards, placement videos, new video uploads, creatives[], adSetId, RESERVED buying.
59296
59327
  * - Placement validation uses existing Instagram identities only. Existing campaign or creative nodes are marked skipped.