@getlatedev/node 0.2.1149 → 0.2.1151

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
@@ -20728,6 +20728,16 @@ type GetAllAccountsHealthResponse = ({
20728
20728
  */
20729
20729
  needsReconnect?: boolean;
20730
20730
  issues?: Array<(string)>;
20731
+ /**
20732
+ * Absent on platforms without analytics sync. failing: several consecutive sync attempts failed. stalled: a sync was requested over 6 hours ago and never completed. never_synced: no sync has completed yet. Failing and stalled raise the account status to at least warning.
20733
+ */
20734
+ analyticsSync?: {
20735
+ status?: 'ok' | 'failing' | 'stalled' | 'never_synced';
20736
+ /**
20737
+ * Last successful sync. Null when never synced or the latest attempt failed.
20738
+ */
20739
+ lastSyncedAt?: (string) | null;
20740
+ };
20731
20741
  /**
20732
20742
  * Observed from Meta's own errors on our own sends, not a live probe. Facebook/Instagram: error subcodes 2534122, 1893063, 2534029, set on the first refused send and cleared when a later send succeeds. WhatsApp: Cloud API error codes 131042 (payment or eligibility issue), 131031 (Business Account locked) and 368 (policy block), set when a send or a delivery status fails with one and cleared when a later message is delivered. It lags reality by one message in each direction. After subcode 1893063 (Meta refusing the Page's messages), comment automation DMs are held and one is retried at `pausedUntil`: 30 minutes, doubling per refused retry up to 4 hours; held DMs stay pending and are sent once Meta accepts again, within the 7-day private-reply window.
20733
20743
  */
@@ -20882,6 +20892,16 @@ type GetAccountHealthResponse = ({
20882
20892
  * Actionable recommendations to fix issues
20883
20893
  */
20884
20894
  recommendations?: Array<(string)>;
20895
+ /**
20896
+ * Absent on platforms without analytics sync. failing: several consecutive sync attempts failed. stalled: a sync was requested over 6 hours ago and never completed. never_synced: no sync has completed yet. Failing and stalled raise the account status to at least warning.
20897
+ */
20898
+ analyticsSync?: {
20899
+ status?: 'ok' | 'failing' | 'stalled' | 'never_synced';
20900
+ /**
20901
+ * Last successful sync. Null when never synced or the latest attempt failed.
20902
+ */
20903
+ lastSyncedAt?: (string) | null;
20904
+ };
20885
20905
  /**
20886
20906
  * Observed from Meta's own errors on our own sends, not a live probe. Facebook/Instagram: error subcodes 2534122, 1893063, 2534029, set on the first refused send and cleared when a later send succeeds. WhatsApp: Cloud API error codes 131042 (payment or eligibility issue), 131031 (Business Account locked) and 368 (policy block), set when a send or a delivery status fails with one and cleared when a later message is delivered. It lags reality by one message in each direction. After subcode 1893063 (Meta refusing the Page's messages), comment automation DMs are held and one is retried at `pausedUntil`: 30 minutes, doubling per refused retry up to 4 hours; held DMs stay pending and are sent once Meta accepts again, within the 7-day private-reply window.
20887
20907
  */
package/dist/index.d.ts CHANGED
@@ -20728,6 +20728,16 @@ type GetAllAccountsHealthResponse = ({
20728
20728
  */
20729
20729
  needsReconnect?: boolean;
20730
20730
  issues?: Array<(string)>;
20731
+ /**
20732
+ * Absent on platforms without analytics sync. failing: several consecutive sync attempts failed. stalled: a sync was requested over 6 hours ago and never completed. never_synced: no sync has completed yet. Failing and stalled raise the account status to at least warning.
20733
+ */
20734
+ analyticsSync?: {
20735
+ status?: 'ok' | 'failing' | 'stalled' | 'never_synced';
20736
+ /**
20737
+ * Last successful sync. Null when never synced or the latest attempt failed.
20738
+ */
20739
+ lastSyncedAt?: (string) | null;
20740
+ };
20731
20741
  /**
20732
20742
  * Observed from Meta's own errors on our own sends, not a live probe. Facebook/Instagram: error subcodes 2534122, 1893063, 2534029, set on the first refused send and cleared when a later send succeeds. WhatsApp: Cloud API error codes 131042 (payment or eligibility issue), 131031 (Business Account locked) and 368 (policy block), set when a send or a delivery status fails with one and cleared when a later message is delivered. It lags reality by one message in each direction. After subcode 1893063 (Meta refusing the Page's messages), comment automation DMs are held and one is retried at `pausedUntil`: 30 minutes, doubling per refused retry up to 4 hours; held DMs stay pending and are sent once Meta accepts again, within the 7-day private-reply window.
20733
20743
  */
@@ -20882,6 +20892,16 @@ type GetAccountHealthResponse = ({
20882
20892
  * Actionable recommendations to fix issues
20883
20893
  */
20884
20894
  recommendations?: Array<(string)>;
20895
+ /**
20896
+ * Absent on platforms without analytics sync. failing: several consecutive sync attempts failed. stalled: a sync was requested over 6 hours ago and never completed. never_synced: no sync has completed yet. Failing and stalled raise the account status to at least warning.
20897
+ */
20898
+ analyticsSync?: {
20899
+ status?: 'ok' | 'failing' | 'stalled' | 'never_synced';
20900
+ /**
20901
+ * Last successful sync. Null when never synced or the latest attempt failed.
20902
+ */
20903
+ lastSyncedAt?: (string) | null;
20904
+ };
20885
20905
  /**
20886
20906
  * Observed from Meta's own errors on our own sends, not a live probe. Facebook/Instagram: error subcodes 2534122, 1893063, 2534029, set on the first refused send and cleared when a later send succeeds. WhatsApp: Cloud API error codes 131042 (payment or eligibility issue), 131031 (Business Account locked) and 368 (policy block), set when a send or a delivery status fails with one and cleared when a later message is delivered. It lags reality by one message in each direction. After subcode 1893063 (Meta refusing the Page's messages), comment automation DMs are held and one is retried at `pausedUntil`: 30 minutes, doubling per refused retry up to 4 hours; held DMs stay pending and are sent once Meta accepts again, within the 7-day private-reply window.
20887
20907
  */
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.1149",
39
+ version: "0.2.1151",
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.1149",
8
+ version: "0.2.1151",
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.1149",
3
+ "version": "0.2.1151",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -1396,7 +1396,7 @@ export const deleteAccount = <ThrowOnError extends boolean = false>(options: Opt
1396
1396
 
1397
1397
  /**
1398
1398
  * Check accounts health
1399
- * Returns health status of all connected accounts including token validity, permissions, and issues needing attention.
1399
+ * Returns health status of all connected accounts including token validity, permissions, and issues needing attention. A failing or stalled analytics sync (see `analyticsSync`) raises a healthy account to at least warning.
1400
1400
  */
1401
1401
  export const getAllAccountsHealth = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<GetAllAccountsHealthData, ThrowOnError>) => {
1402
1402
  return (options?.client ?? client).get<GetAllAccountsHealthResponse, GetAllAccountsHealthError, ThrowOnError>({
@@ -1456,6 +1456,8 @@ export const verifyWhatsAppNumber = <ThrowOnError extends boolean = false>(optio
1456
1456
  * Check account health
1457
1457
  * Returns detailed health info for a specific account including token status, permissions, and recommendations.
1458
1458
  *
1459
+ * A failing or stalled analytics sync (see `analyticsSync`) raises a healthy account to at least `warning`.
1460
+ *
1459
1461
  * For WhatsApp accounts the response also includes `platformConnection`, a live probe of the
1460
1462
  * Meta link behind the channel (the same read as `GET /v1/whatsapp/number-info`). The OAuth
1461
1463
  * token can be perfectly valid while Meta refuses to serve the phone-number object (for
@@ -13749,6 +13751,8 @@ export const sendWhatsAppConversion = <ThrowOnError extends boolean = false>(opt
13749
13751
  * `accountId` is a Facebook, Instagram or Meta ads (business login) connection;
13750
13752
  * `pageId` picks the Page when that connection was granted several.
13751
13753
  *
13754
+ * **WhatsApp number prerequisite.** For the WhatsApp destination, link the WhatsApp number to the Facebook Page used for the ad before creating it: Meta checks the pairing at creation. Link it from the WhatsApp Business app (Settings > Business tools > Facebook & Instagram) or from the Page settings (Linked accounts > WhatsApp). Linking does not affect the number's WhatsApp connection in Zernio (Cloud API or coexistence), so no reconnect or re-sync is needed. If Meta creates a new ad set without the requested `whatsappPhoneNumber`, the 201 response carries a `warnings` entry. This can happen even when the number is linked (Meta can drop a Page's second linked number).
13755
+ *
13752
13756
  * **Idempotency:** this endpoint is not idempotent at the platform level (a blind retry creates a second campaign/ad set/ad). Send an `Idempotency-Key` header to make retries safe: the first request with a given key creates the ad and we store the response; a retry with the same key replays that exact response (with `Idempotent-Replayed: true`) instead of creating duplicates. Reusing a key with a different body returns 422; a key whose first request is still in flight returns 409 (retry after a short backoff). Keys are scoped to your credential and expire after 24h.
13753
13757
  */
13754
13758
  export const createMessagingAd = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateMessagingAdData, ThrowOnError>) => {
@@ -13795,6 +13799,8 @@ export const createCallAd = <ThrowOnError extends boolean = false>(options: Opti
13795
13799
  * media and copy for that creative. Optional `whatsappPhoneNumber` selects
13796
13800
  * a number already paired with the Page (WhatsApp destination only).
13797
13801
  *
13802
+ * **WhatsApp number prerequisite.** Link the WhatsApp number to the Facebook Page used for the ad before creating it: Meta checks the pairing at creation. Link it from the WhatsApp Business app (Settings > Business tools > Facebook & Instagram) or from the Page settings (Linked accounts > WhatsApp). Linking does not affect the number's WhatsApp connection in Zernio (Cloud API or coexistence), so no reconnect or re-sync is needed. If Meta creates a new ad set without the requested `whatsappPhoneNumber`, the 201 response carries a `warnings` entry. This can happen even when the number is linked (Meta can drop a Page's second linked number).
13803
+ *
13798
13804
  * **Idempotency:** this endpoint is not idempotent at the platform level (a blind retry creates a second campaign/ad set/ad). Send an `Idempotency-Key` header to make retries safe: the first request with a given key creates the ad and we store the response; a retry with the same key replays that exact response (with `Idempotent-Replayed: true`) instead of creating duplicates. Reusing a key with a different body returns 422; a key whose first request is still in flight returns 409 (retry after a short backoff). Keys are scoped to your credential and expire after 24h.
13799
13805
  */
13800
13806
  export const createCtwaAd = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateCtwaAdData, ThrowOnError>) => {
@@ -19626,6 +19626,16 @@ export type GetAllAccountsHealthResponse = ({
19626
19626
  */
19627
19627
  needsReconnect?: boolean;
19628
19628
  issues?: Array<(string)>;
19629
+ /**
19630
+ * Absent on platforms without analytics sync. failing: several consecutive sync attempts failed. stalled: a sync was requested over 6 hours ago and never completed. never_synced: no sync has completed yet. Failing and stalled raise the account status to at least warning.
19631
+ */
19632
+ analyticsSync?: {
19633
+ status?: 'ok' | 'failing' | 'stalled' | 'never_synced';
19634
+ /**
19635
+ * Last successful sync. Null when never synced or the latest attempt failed.
19636
+ */
19637
+ lastSyncedAt?: (string) | null;
19638
+ };
19629
19639
  /**
19630
19640
  * Observed from Meta's own errors on our own sends, not a live probe. Facebook/Instagram: error subcodes 2534122, 1893063, 2534029, set on the first refused send and cleared when a later send succeeds. WhatsApp: Cloud API error codes 131042 (payment or eligibility issue), 131031 (Business Account locked) and 368 (policy block), set when a send or a delivery status fails with one and cleared when a later message is delivered. It lags reality by one message in each direction. After subcode 1893063 (Meta refusing the Page's messages), comment automation DMs are held and one is retried at `pausedUntil`: 30 minutes, doubling per refused retry up to 4 hours; held DMs stay pending and are sent once Meta accepts again, within the 7-day private-reply window.
19631
19641
  */
@@ -19792,6 +19802,16 @@ export type GetAccountHealthResponse = ({
19792
19802
  * Actionable recommendations to fix issues
19793
19803
  */
19794
19804
  recommendations?: Array<(string)>;
19805
+ /**
19806
+ * Absent on platforms without analytics sync. failing: several consecutive sync attempts failed. stalled: a sync was requested over 6 hours ago and never completed. never_synced: no sync has completed yet. Failing and stalled raise the account status to at least warning.
19807
+ */
19808
+ analyticsSync?: {
19809
+ status?: 'ok' | 'failing' | 'stalled' | 'never_synced';
19810
+ /**
19811
+ * Last successful sync. Null when never synced or the latest attempt failed.
19812
+ */
19813
+ lastSyncedAt?: (string) | null;
19814
+ };
19795
19815
  /**
19796
19816
  * Observed from Meta's own errors on our own sends, not a live probe. Facebook/Instagram: error subcodes 2534122, 1893063, 2534029, set on the first refused send and cleared when a later send succeeds. WhatsApp: Cloud API error codes 131042 (payment or eligibility issue), 131031 (Business Account locked) and 368 (policy block), set when a send or a delivery status fails with one and cleared when a later message is delivered. It lags reality by one message in each direction. After subcode 1893063 (Meta refusing the Page's messages), comment automation DMs are held and one is retried at `pausedUntil`: 30 minutes, doubling per refused retry up to 4 hours; held DMs stay pending and are sent once Meta accepts again, within the 7-day private-reply window.
19797
19817
  */