@getlatedev/node 0.2.1294 → 0.2.1296
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 +14 -6
- package/dist/index.d.ts +14 -6
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/generated/sdk.gen.ts +14 -12
- package/src/generated/types.gen.ts +14 -6
package/dist/index.d.mts
CHANGED
|
@@ -6724,6 +6724,11 @@ type ConversionEvent = {
|
|
|
6724
6724
|
* for Business Messaging). `channel` is sent as the event's `messaging_channel`
|
|
6725
6725
|
* (`instagram_direct` goes out as `instagram`). Each id lands in Meta's
|
|
6726
6726
|
* `user_data` unhashed, and an id that does not belong to `channel` is ignored.
|
|
6727
|
+
* Meta accepts only its business messaging event names here (`LeadSubmitted`,
|
|
6728
|
+
* `QualifiedLead`, `Purchase`, `AddToCart`, `InitiateCheckout`, `ViewContent`,
|
|
6729
|
+
* `OrderCreated`, `OrderShipped`, `OrderDelivered`, `OrderCanceled`,
|
|
6730
|
+
* `OrderReturned`, `CartAbandoned`, `RatingProvided`, `ReviewProvided`);
|
|
6731
|
+
* `eventName` is forwarded unchanged.
|
|
6727
6732
|
*
|
|
6728
6733
|
*/
|
|
6729
6734
|
messaging?: {
|
|
@@ -53785,7 +53790,7 @@ type ListWhatsAppConversionsResponse = ({
|
|
|
53785
53790
|
*/
|
|
53786
53791
|
timestamp?: string;
|
|
53787
53792
|
/**
|
|
53788
|
-
* One of LeadSubmitted, Purchase, AddToCart, InitiateCheckout, ViewContent.
|
|
53793
|
+
* One of LeadSubmitted, QualifiedLead, Purchase, AddToCart, InitiateCheckout, ViewContent, OrderCreated, OrderCanceled, OrderReturned.
|
|
53789
53794
|
*/
|
|
53790
53795
|
eventName?: string;
|
|
53791
53796
|
conversationId?: (string) | null;
|
|
@@ -53812,9 +53817,8 @@ type SendWhatsAppConversionData = {
|
|
|
53812
53817
|
*/
|
|
53813
53818
|
accountId: string;
|
|
53814
53819
|
/**
|
|
53815
|
-
*
|
|
53816
|
-
*
|
|
53817
|
-
* standard pixel events including `Lead`,
|
|
53820
|
+
* Event names accepted by Meta's CAPI for Business
|
|
53821
|
+
* Messaging. Other standard pixel events including `Lead`,
|
|
53818
53822
|
* `CompleteRegistration`, `Subscribe`, `Schedule`, `Contact`,
|
|
53819
53823
|
* `StartTrial`, `AddPaymentInfo`, `Search`, and
|
|
53820
53824
|
* `SubmitApplication` are rejected with subcode 2804066
|
|
@@ -53822,10 +53826,14 @@ type SendWhatsAppConversionData = {
|
|
|
53822
53826
|
* `action_source = business_messaging` events. Custom event
|
|
53823
53827
|
* names are also rejected.
|
|
53824
53828
|
*
|
|
53825
|
-
* Use `LeadSubmitted` (NOT `Lead`)
|
|
53829
|
+
* Use `LeadSubmitted` (NOT `Lead`) when a lead comes in and
|
|
53830
|
+
* `QualifiedLead` once your team qualifies it. `OrderCreated`,
|
|
53831
|
+
* `OrderCanceled` and `OrderReturned` track an order placed in
|
|
53832
|
+
* the chat; send `value` and `currency` with them (and with
|
|
53833
|
+
* `Purchase`) to report the order amount.
|
|
53826
53834
|
*
|
|
53827
53835
|
*/
|
|
53828
|
-
eventName: 'LeadSubmitted' | 'Purchase' | 'AddToCart' | 'InitiateCheckout' | 'ViewContent';
|
|
53836
|
+
eventName: 'LeadSubmitted' | 'QualifiedLead' | 'Purchase' | 'AddToCart' | 'InitiateCheckout' | 'ViewContent' | 'OrderCreated' | 'OrderCanceled' | 'OrderReturned';
|
|
53829
53837
|
/**
|
|
53830
53838
|
* Unix seconds. Defaults to the time of the request when
|
|
53831
53839
|
* omitted. Meta's attribution window is 7 days from click;
|
package/dist/index.d.ts
CHANGED
|
@@ -6724,6 +6724,11 @@ type ConversionEvent = {
|
|
|
6724
6724
|
* for Business Messaging). `channel` is sent as the event's `messaging_channel`
|
|
6725
6725
|
* (`instagram_direct` goes out as `instagram`). Each id lands in Meta's
|
|
6726
6726
|
* `user_data` unhashed, and an id that does not belong to `channel` is ignored.
|
|
6727
|
+
* Meta accepts only its business messaging event names here (`LeadSubmitted`,
|
|
6728
|
+
* `QualifiedLead`, `Purchase`, `AddToCart`, `InitiateCheckout`, `ViewContent`,
|
|
6729
|
+
* `OrderCreated`, `OrderShipped`, `OrderDelivered`, `OrderCanceled`,
|
|
6730
|
+
* `OrderReturned`, `CartAbandoned`, `RatingProvided`, `ReviewProvided`);
|
|
6731
|
+
* `eventName` is forwarded unchanged.
|
|
6727
6732
|
*
|
|
6728
6733
|
*/
|
|
6729
6734
|
messaging?: {
|
|
@@ -53785,7 +53790,7 @@ type ListWhatsAppConversionsResponse = ({
|
|
|
53785
53790
|
*/
|
|
53786
53791
|
timestamp?: string;
|
|
53787
53792
|
/**
|
|
53788
|
-
* One of LeadSubmitted, Purchase, AddToCart, InitiateCheckout, ViewContent.
|
|
53793
|
+
* One of LeadSubmitted, QualifiedLead, Purchase, AddToCart, InitiateCheckout, ViewContent, OrderCreated, OrderCanceled, OrderReturned.
|
|
53789
53794
|
*/
|
|
53790
53795
|
eventName?: string;
|
|
53791
53796
|
conversationId?: (string) | null;
|
|
@@ -53812,9 +53817,8 @@ type SendWhatsAppConversionData = {
|
|
|
53812
53817
|
*/
|
|
53813
53818
|
accountId: string;
|
|
53814
53819
|
/**
|
|
53815
|
-
*
|
|
53816
|
-
*
|
|
53817
|
-
* standard pixel events including `Lead`,
|
|
53820
|
+
* Event names accepted by Meta's CAPI for Business
|
|
53821
|
+
* Messaging. Other standard pixel events including `Lead`,
|
|
53818
53822
|
* `CompleteRegistration`, `Subscribe`, `Schedule`, `Contact`,
|
|
53819
53823
|
* `StartTrial`, `AddPaymentInfo`, `Search`, and
|
|
53820
53824
|
* `SubmitApplication` are rejected with subcode 2804066
|
|
@@ -53822,10 +53826,14 @@ type SendWhatsAppConversionData = {
|
|
|
53822
53826
|
* `action_source = business_messaging` events. Custom event
|
|
53823
53827
|
* names are also rejected.
|
|
53824
53828
|
*
|
|
53825
|
-
* Use `LeadSubmitted` (NOT `Lead`)
|
|
53829
|
+
* Use `LeadSubmitted` (NOT `Lead`) when a lead comes in and
|
|
53830
|
+
* `QualifiedLead` once your team qualifies it. `OrderCreated`,
|
|
53831
|
+
* `OrderCanceled` and `OrderReturned` track an order placed in
|
|
53832
|
+
* the chat; send `value` and `currency` with them (and with
|
|
53833
|
+
* `Purchase`) to report the order amount.
|
|
53826
53834
|
*
|
|
53827
53835
|
*/
|
|
53828
|
-
eventName: 'LeadSubmitted' | 'Purchase' | 'AddToCart' | 'InitiateCheckout' | 'ViewContent';
|
|
53836
|
+
eventName: 'LeadSubmitted' | 'QualifiedLead' | 'Purchase' | 'AddToCart' | 'InitiateCheckout' | 'ViewContent' | 'OrderCreated' | 'OrderCanceled' | 'OrderReturned';
|
|
53829
53837
|
/**
|
|
53830
53838
|
* Unix seconds. Defaults to the time of the request when
|
|
53831
53839
|
* omitted. Meta's attribution window is 7 days from click;
|
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.
|
|
39
|
+
version: "0.2.1296",
|
|
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.
|
|
8
|
+
version: "0.2.1296",
|
|
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
|
@@ -11462,13 +11462,14 @@ export const getAdReview = <ThrowOnError extends boolean = false>(options: Optio
|
|
|
11462
11462
|
* carousel under its own material id, so those entries come back with the review verdict and
|
|
11463
11463
|
* null descriptive fields. TikTok returns no review timestamp; `readAt` is when Zernio read it.
|
|
11464
11464
|
*
|
|
11465
|
-
* TikTok's review endpoint has a strict quota of its own. One TikTok call reads the
|
|
11466
|
-
*
|
|
11467
|
-
* connection, advertiser and Smart+ ad, so sibling ads
|
|
11468
|
-
* can be up to 10 minutes old. Read reviews when you need
|
|
11469
|
-
* loop. When TikTok answers over quota, Zernio returns 429
|
|
11470
|
-
* 429 for that advertiser and connection without calling TikTok
|
|
11471
|
-
*
|
|
11465
|
+
* TikTok's review endpoint has a strict quota of its own, which behaves per advertiser. One TikTok call reads the
|
|
11466
|
+
* review of the live Smart+ ads of the ad group up to 50 creatives in total (TikTok refuses more),
|
|
11467
|
+
* and each review is cached for 10 minutes per connection, advertiser and Smart+ ad, so sibling ads
|
|
11468
|
+
* are answered from the cache and `readAt` can be up to 10 minutes old. Read reviews when you need
|
|
11469
|
+
* them instead of sweeping every ad on a loop. When TikTok answers over quota, Zernio returns 429
|
|
11470
|
+
* and answers 429 for that advertiser and connection without calling TikTok for 60 seconds, then
|
|
11471
|
+
* 120, then 240 while TikTok keeps refusing (back to 60 after a successful call), with the time left
|
|
11472
|
+
* as `Retry-After`; cached reviews are still served.
|
|
11472
11473
|
*/
|
|
11473
11474
|
export const getTikTokSmartPlusAdReview = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetTikTokSmartPlusAdReviewData, ThrowOnError>) => {
|
|
11474
11475
|
return (options?.client ?? client).get<GetTikTokSmartPlusAdReviewResponse, GetTikTokSmartPlusAdReviewError, ThrowOnError>({
|
|
@@ -11992,13 +11993,13 @@ export const getTikTokSmartPlusMaterialReport = <ThrowOnError extends boolean =
|
|
|
11992
11993
|
* Review status of every TikTok Smart+ ad of an advertiser
|
|
11993
11994
|
* Returns the review verdict of every Upgraded Smart+ ad of one TikTok advertiser, with each creative's verdict, in one paginated read. Use it to refresh reviews periodically: one call (plus its pages) per advertiser per refresh, instead of `GET /v1/ads/{adId}/tiktok-smart-plus-review` per ad.
|
|
11994
11995
|
*
|
|
11995
|
-
* Zernio lists the advertiser's Smart+ ads with `/smart_plus/ad/get/` (deleted ones only with `includeDeleted=true`; the listing is cached for
|
|
11996
|
+
* Zernio lists the advertiser's Smart+ ads with `/smart_plus/ad/get/` (deleted ones only with `includeDeleted=true`; the listing is cached for 10 minutes) and reads `/smart_plus/ad/review_info/` for Smart+ ads holding up to 50 creatives in total per call (TikTok refuses more; a Smart+ ad with more than 50 creatives is read alone), across ad groups, one call after another. A full refresh of N Smart+ ads with C creatives in total costs about `ceil(N / 100)` listing calls and `ceil(C / 50)` review calls on TikTok. When TikTok still refuses a call for its creative count, Zernio lowers the creative cap for that advertiser and reads the same ads again in smaller calls, never resending the refused size. Each review is cached for 10 minutes per connection, advertiser and Smart+ ad, shared with the single-ad read, so cached reviews are served without calling TikTok and `readAt` can be up to 10 minutes old.
|
|
11996
11997
|
*
|
|
11997
|
-
* TikTok's review endpoint has a strict quota of its own. When it is over quota (or Zernio is holding review reads for this advertiser and connection after an overage), Zernio stops calling TikTok and answers 200 with the reviews it has: `incomplete: true`, the Smart+ ads still to read in `pendingSmartPlusAdIds`, and `retryAfterSeconds` (also in the `Retry-After` header). Every Smart+ ad of the page is in `items`, `failedSmartPlusAds` or `pendingSmartPlusAdIds`. Wait `retryAfterSeconds` and read the same page again: only the pending ads reach TikTok.
|
|
11998
|
+
* TikTok's review endpoint has a strict quota of its own, which behaves per advertiser. When it is over quota (or Zernio is holding review reads for this advertiser and connection after an overage: 60 seconds, then 120, then 240 while TikTok keeps refusing, back to 60 after a successful call), Zernio stops calling TikTok and answers 200 with the reviews it has: `incomplete: true`, the Smart+ ads still to read in `pendingSmartPlusAdIds`, and `retryAfterSeconds` (also in the `Retry-After` header). Every Smart+ ad of the page is in `items`, `failedSmartPlusAds` or `pendingSmartPlusAdIds`. Wait `retryAfterSeconds` and read the same page again: only the pending ads reach TikTok.
|
|
11998
11999
|
*
|
|
11999
12000
|
* A Smart+ ad whose review TikTok refuses on its own (for example one deleted on TikTok since the listing was cached) is returned in `failedSmartPlusAds` with TikTok's error, and the rest of the page is still read. Zernio finds it by splitting the refused batch in halves, at most 16 extra TikTok calls per page; ads still unresolved after that come back in `failedSmartPlusAds` with the batch error. A refusal of a single ad is remembered for 10 minutes. When both halves of a refused batch are refused with the same TikTok error (for example a permission error), the whole request fails with that error instead.
|
|
12000
12001
|
*
|
|
12001
|
-
* Items are sorted by `adGroupId`, then `smartPlusAdId`, so pages are stable.
|
|
12002
|
+
* Items are sorted by `adGroupId`, then `smartPlusAdId`, so pages are stable. Keep one page in flight per advertiser and read its pages one after another: parallel pages of one advertiser spend its review quota at the same time and come back incomplete. The quota behaves per advertiser (observed, not documented by TikTok), so different advertisers can be read in parallel.
|
|
12002
12003
|
*/
|
|
12003
12004
|
export const listTikTokSmartPlusReviews = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ListTikTokSmartPlusReviewsData, ThrowOnError>) => {
|
|
12004
12005
|
return (options?.client ?? client).get<ListTikTokSmartPlusReviewsResponse, ListTikTokSmartPlusReviewsError, ThrowOnError>({
|
|
@@ -15026,8 +15027,9 @@ export const listWhatsAppConversions = <ThrowOnError extends boolean = false>(op
|
|
|
15026
15027
|
/**
|
|
15027
15028
|
* Send WhatsApp conversion event
|
|
15028
15029
|
* Forward a WhatsApp Business Messaging conversion event (`LeadSubmitted`,
|
|
15029
|
-
* `Purchase`, `AddToCart`, `InitiateCheckout`,
|
|
15030
|
-
*
|
|
15030
|
+
* `QualifiedLead`, `Purchase`, `AddToCart`, `InitiateCheckout`,
|
|
15031
|
+
* `ViewContent`, `OrderCreated`, `OrderCanceled`, `OrderReturned`) to
|
|
15032
|
+
* Meta's Conversions API with `action_source = business_messaging` and
|
|
15031
15033
|
* `messaging_channel = whatsapp`. The endpoint looks up the originating
|
|
15032
15034
|
* CTWA click ID (`ctwa_clid`) captured on the first inbound message of
|
|
15033
15035
|
* the conversation and replays it on every event so Meta can attribute
|
|
@@ -4864,6 +4864,11 @@ export type ConversionEvent = {
|
|
|
4864
4864
|
* for Business Messaging). `channel` is sent as the event's `messaging_channel`
|
|
4865
4865
|
* (`instagram_direct` goes out as `instagram`). Each id lands in Meta's
|
|
4866
4866
|
* `user_data` unhashed, and an id that does not belong to `channel` is ignored.
|
|
4867
|
+
* Meta accepts only its business messaging event names here (`LeadSubmitted`,
|
|
4868
|
+
* `QualifiedLead`, `Purchase`, `AddToCart`, `InitiateCheckout`, `ViewContent`,
|
|
4869
|
+
* `OrderCreated`, `OrderShipped`, `OrderDelivered`, `OrderCanceled`,
|
|
4870
|
+
* `OrderReturned`, `CartAbandoned`, `RatingProvided`, `ReviewProvided`);
|
|
4871
|
+
* `eventName` is forwarded unchanged.
|
|
4867
4872
|
*
|
|
4868
4873
|
*/
|
|
4869
4874
|
messaging?: {
|
|
@@ -54898,7 +54903,7 @@ export type ListWhatsAppConversionsResponse = ({
|
|
|
54898
54903
|
*/
|
|
54899
54904
|
timestamp?: string;
|
|
54900
54905
|
/**
|
|
54901
|
-
* One of LeadSubmitted, Purchase, AddToCart, InitiateCheckout, ViewContent.
|
|
54906
|
+
* One of LeadSubmitted, QualifiedLead, Purchase, AddToCart, InitiateCheckout, ViewContent, OrderCreated, OrderCanceled, OrderReturned.
|
|
54902
54907
|
*/
|
|
54903
54908
|
eventName?: string;
|
|
54904
54909
|
conversationId?: (string) | null;
|
|
@@ -54927,9 +54932,8 @@ export type SendWhatsAppConversionData = {
|
|
|
54927
54932
|
*/
|
|
54928
54933
|
accountId: string;
|
|
54929
54934
|
/**
|
|
54930
|
-
*
|
|
54931
|
-
*
|
|
54932
|
-
* standard pixel events including `Lead`,
|
|
54935
|
+
* Event names accepted by Meta's CAPI for Business
|
|
54936
|
+
* Messaging. Other standard pixel events including `Lead`,
|
|
54933
54937
|
* `CompleteRegistration`, `Subscribe`, `Schedule`, `Contact`,
|
|
54934
54938
|
* `StartTrial`, `AddPaymentInfo`, `Search`, and
|
|
54935
54939
|
* `SubmitApplication` are rejected with subcode 2804066
|
|
@@ -54937,10 +54941,14 @@ export type SendWhatsAppConversionData = {
|
|
|
54937
54941
|
* `action_source = business_messaging` events. Custom event
|
|
54938
54942
|
* names are also rejected.
|
|
54939
54943
|
*
|
|
54940
|
-
* Use `LeadSubmitted` (NOT `Lead`)
|
|
54944
|
+
* Use `LeadSubmitted` (NOT `Lead`) when a lead comes in and
|
|
54945
|
+
* `QualifiedLead` once your team qualifies it. `OrderCreated`,
|
|
54946
|
+
* `OrderCanceled` and `OrderReturned` track an order placed in
|
|
54947
|
+
* the chat; send `value` and `currency` with them (and with
|
|
54948
|
+
* `Purchase`) to report the order amount.
|
|
54941
54949
|
*
|
|
54942
54950
|
*/
|
|
54943
|
-
eventName: 'LeadSubmitted' | 'Purchase' | 'AddToCart' | 'InitiateCheckout' | 'ViewContent';
|
|
54951
|
+
eventName: 'LeadSubmitted' | 'QualifiedLead' | 'Purchase' | 'AddToCart' | 'InitiateCheckout' | 'ViewContent' | 'OrderCreated' | 'OrderCanceled' | 'OrderReturned';
|
|
54944
54952
|
/**
|
|
54945
54953
|
* Unix seconds. Defaults to the time of the request when
|
|
54946
54954
|
* omitted. Meta's attribution window is 7 days from click;
|