@getlatedev/node 0.2.1438 → 0.2.1440

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
@@ -41313,6 +41313,10 @@ type TransferVoiceCallResponse = ({
41313
41313
  type TransferVoiceCallError = (ErrorResponse | unknown);
41314
41314
  type GetVoiceCallEstimateData = {
41315
41315
  query: {
41316
+ /**
41317
+ * Destination the call bridges to: `tel:+E164`, `sip:...` or `wss://...`. Defaults to the dialing number's configured forward. A `tel:` destination adds a second carrier leg to the quote. Encode the `+` as `%2B`.
41318
+ */
41319
+ forwardTo?: string;
41316
41320
  /**
41317
41321
  * The number the call would dial from, E.164. When it is verified on a Branded Calling identity and `to` is a US number, the estimate includes the per-call Branded Calling surcharge.
41318
41322
  */
@@ -56597,12 +56601,40 @@ type GetAdAccountHealthData = {
56597
56601
  type GetAdAccountHealthResponse = ({
56598
56602
  adAccountId?: string;
56599
56603
  status?: 'ok' | 'attention' | 'blocked';
56604
+ /**
56605
+ * False when a create or boost on this ad account would be refused; `blockers` says why.
56606
+ */
56607
+ ready?: boolean;
56608
+ blockers?: Array<{
56609
+ /**
56610
+ * The `checks[].id` that blocks.
56611
+ */
56612
+ check: string;
56613
+ /**
56614
+ * The error code a refused create or boost returns for this reason.
56615
+ */
56616
+ code: string;
56617
+ message: string;
56618
+ /**
56619
+ * What to do, in English.
56620
+ */
56621
+ hint: string;
56622
+ fix?: {
56623
+ label?: string;
56624
+ url?: string;
56625
+ };
56626
+ }>;
56600
56627
  checkedAt?: string;
56601
56628
  checks?: Array<{
56602
- id: 'account_status' | 'payment' | 'spend_cap' | 'page' | 'instagram' | 'lead_terms' | 'pixel' | 'whatsapp';
56629
+ id: 'account_status' | 'payment' | 'spend_cap' | 'page' | 'instagram' | 'lead_terms' | 'pixel' | 'whatsapp' | 'last_refusal';
56603
56630
  status: 'ok' | 'warning' | 'error' | 'missing' | 'unknown';
56604
56631
  title: string;
56605
56632
  message: string;
56633
+ /**
56634
+ * When the check is not `ok`: the error code a create refused for this reason returns.
56635
+ */
56636
+ code?: string;
56637
+ hint?: string;
56606
56638
  fix?: {
56607
56639
  label?: string;
56608
56640
  url?: string;
@@ -57701,6 +57733,7 @@ type BoostPostData = {
57701
57733
  *
57702
57734
  * - Idempotency-Key storage and the duplicate-boost guard are bypassed.
57703
57735
  * - Counts toward the 30 Meta writes per ad account per 5 minutes.
57736
+ * - 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
57737
  * - With `adSetId`, only the ad is dry-run.
57705
57738
  * - 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
57739
  *
@@ -58098,6 +58131,8 @@ type CreateStandaloneAdData = {
58098
58131
  *
58099
58132
  * **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
58133
  *
58134
+ * 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.
58135
+ *
58101
58136
  * - 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
58137
  * - Return 400: dynamicCreative, translations, carouselCards, placement videos, new video uploads, creatives[], adSetId, RESERVED buying.
58103
58138
  * - Placement validation uses existing Instagram identities only. Existing campaign or creative nodes are marked skipped.
package/dist/index.d.ts CHANGED
@@ -41313,6 +41313,10 @@ type TransferVoiceCallResponse = ({
41313
41313
  type TransferVoiceCallError = (ErrorResponse | unknown);
41314
41314
  type GetVoiceCallEstimateData = {
41315
41315
  query: {
41316
+ /**
41317
+ * Destination the call bridges to: `tel:+E164`, `sip:...` or `wss://...`. Defaults to the dialing number's configured forward. A `tel:` destination adds a second carrier leg to the quote. Encode the `+` as `%2B`.
41318
+ */
41319
+ forwardTo?: string;
41316
41320
  /**
41317
41321
  * The number the call would dial from, E.164. When it is verified on a Branded Calling identity and `to` is a US number, the estimate includes the per-call Branded Calling surcharge.
41318
41322
  */
@@ -56597,12 +56601,40 @@ type GetAdAccountHealthData = {
56597
56601
  type GetAdAccountHealthResponse = ({
56598
56602
  adAccountId?: string;
56599
56603
  status?: 'ok' | 'attention' | 'blocked';
56604
+ /**
56605
+ * False when a create or boost on this ad account would be refused; `blockers` says why.
56606
+ */
56607
+ ready?: boolean;
56608
+ blockers?: Array<{
56609
+ /**
56610
+ * The `checks[].id` that blocks.
56611
+ */
56612
+ check: string;
56613
+ /**
56614
+ * The error code a refused create or boost returns for this reason.
56615
+ */
56616
+ code: string;
56617
+ message: string;
56618
+ /**
56619
+ * What to do, in English.
56620
+ */
56621
+ hint: string;
56622
+ fix?: {
56623
+ label?: string;
56624
+ url?: string;
56625
+ };
56626
+ }>;
56600
56627
  checkedAt?: string;
56601
56628
  checks?: Array<{
56602
- id: 'account_status' | 'payment' | 'spend_cap' | 'page' | 'instagram' | 'lead_terms' | 'pixel' | 'whatsapp';
56629
+ id: 'account_status' | 'payment' | 'spend_cap' | 'page' | 'instagram' | 'lead_terms' | 'pixel' | 'whatsapp' | 'last_refusal';
56603
56630
  status: 'ok' | 'warning' | 'error' | 'missing' | 'unknown';
56604
56631
  title: string;
56605
56632
  message: string;
56633
+ /**
56634
+ * When the check is not `ok`: the error code a create refused for this reason returns.
56635
+ */
56636
+ code?: string;
56637
+ hint?: string;
56606
56638
  fix?: {
56607
56639
  label?: string;
56608
56640
  url?: string;
@@ -57701,6 +57733,7 @@ type BoostPostData = {
57701
57733
  *
57702
57734
  * - Idempotency-Key storage and the duplicate-boost guard are bypassed.
57703
57735
  * - Counts toward the 30 Meta writes per ad account per 5 minutes.
57736
+ * - 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
57737
  * - With `adSetId`, only the ad is dry-run.
57705
57738
  * - 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
57739
  *
@@ -58098,6 +58131,8 @@ type CreateStandaloneAdData = {
58098
58131
  *
58099
58132
  * **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
58133
  *
58134
+ * 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.
58135
+ *
58101
58136
  * - 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
58137
  * - Return 400: dynamicCreative, translations, carouselCards, placement videos, new video uploads, creatives[], adSetId, RESERVED buying.
58103
58138
  * - 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.1440",
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.1440",
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.1440",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -8100,7 +8100,7 @@ export const transferVoiceCall = <ThrowOnError extends boolean = false>(options:
8100
8100
  * Estimate call cost
8101
8101
  * Pre-call cost estimate for a PSTN call: the carrier leg plus optional recording and transcription add-ons.
8102
8102
  *
8103
- * It uses the same billing formula as the post-call invoice, so the quote and the final charge can't disagree. The per-minute figure is deliberately conservative (the real cost comes from the settled carrier record after the call), so estimates trend slightly over the actual invoice.
8103
+ * It uses the same billing formula as the post-call invoice, so the quote and the final charge can't disagree. The carrier figure follows the carrier's per-destination rate card: a call dialed from a number in the destination country uses the local mobile rate, and a `tel:` forward destination is quoted as a second carrier leg billed from the same number. The real cost comes from the settled carrier record after the call.
8104
8104
  *
8105
8105
  * Parity endpoint of `GET /v1/whatsapp/calls/estimate`, minus the Meta line. PSTN calls have no separate Meta bill, so `totalCostUSD` equals `billableCostUSD`.
8106
8106
  *
@@ -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>({
@@ -41250,6 +41250,10 @@ export type TransferVoiceCallError = (ErrorResponse | unknown);
41250
41250
 
41251
41251
  export type GetVoiceCallEstimateData = {
41252
41252
  query: {
41253
+ /**
41254
+ * Destination the call bridges to: `tel:+E164`, `sip:...` or `wss://...`. Defaults to the dialing number's configured forward. A `tel:` destination adds a second carrier leg to the quote. Encode the `+` as `%2B`.
41255
+ */
41256
+ forwardTo?: string;
41253
41257
  /**
41254
41258
  * The number the call would dial from, E.164. When it is verified on a Branded Calling identity and `to` is a US number, the estimate includes the per-call Branded Calling surcharge.
41255
41259
  */
@@ -57746,12 +57750,40 @@ export type GetAdAccountHealthData = {
57746
57750
  export type GetAdAccountHealthResponse = ({
57747
57751
  adAccountId?: string;
57748
57752
  status?: 'ok' | 'attention' | 'blocked';
57753
+ /**
57754
+ * False when a create or boost on this ad account would be refused; `blockers` says why.
57755
+ */
57756
+ ready?: boolean;
57757
+ blockers?: Array<{
57758
+ /**
57759
+ * The `checks[].id` that blocks.
57760
+ */
57761
+ check: string;
57762
+ /**
57763
+ * The error code a refused create or boost returns for this reason.
57764
+ */
57765
+ code: string;
57766
+ message: string;
57767
+ /**
57768
+ * What to do, in English.
57769
+ */
57770
+ hint: string;
57771
+ fix?: {
57772
+ label?: string;
57773
+ url?: string;
57774
+ };
57775
+ }>;
57749
57776
  checkedAt?: string;
57750
57777
  checks?: Array<{
57751
- id: 'account_status' | 'payment' | 'spend_cap' | 'page' | 'instagram' | 'lead_terms' | 'pixel' | 'whatsapp';
57778
+ id: 'account_status' | 'payment' | 'spend_cap' | 'page' | 'instagram' | 'lead_terms' | 'pixel' | 'whatsapp' | 'last_refusal';
57752
57779
  status: 'ok' | 'warning' | 'error' | 'missing' | 'unknown';
57753
57780
  title: string;
57754
57781
  message: string;
57782
+ /**
57783
+ * When the check is not `ok`: the error code a create refused for this reason returns.
57784
+ */
57785
+ code?: string;
57786
+ hint?: string;
57755
57787
  fix?: {
57756
57788
  label?: string;
57757
57789
  url?: string;
@@ -58870,6 +58902,7 @@ export type BoostPostData = {
58870
58902
  *
58871
58903
  * - Idempotency-Key storage and the duplicate-boost guard are bypassed.
58872
58904
  * - Counts toward the 30 Meta writes per ad account per 5 minutes.
58905
+ * - 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
58906
  * - With `adSetId`, only the ad is dry-run.
58874
58907
  * - 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
58908
  *
@@ -59291,6 +59324,8 @@ export type CreateStandaloneAdData = {
59291
59324
  *
59292
59325
  * **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
59326
  *
59327
+ * 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.
59328
+ *
59294
59329
  * - 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
59330
  * - Return 400: dynamicCreative, translations, carouselCards, placement videos, new video uploads, creatives[], adSetId, RESERVED buying.
59296
59331
  * - Placement validation uses existing Instagram identities only. Existing campaign or creative nodes are marked skipped.