@getlatedev/node 0.2.1733 → 0.2.1735
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/README.md +1 -1
- package/dist/index.d.mts +55 -9
- package/dist/index.d.ts +55 -9
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/generated/sdk.gen.ts +13 -3
- package/src/generated/types.gen.ts +59 -8
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.1735",
|
|
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.1735",
|
|
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
|
@@ -21033,7 +21033,7 @@ export const getConversionsQuality = <ThrowOnError extends boolean = false>(opti
|
|
|
21033
21033
|
*
|
|
21034
21034
|
* ### TikTok notes
|
|
21035
21035
|
*
|
|
21036
|
-
*
|
|
21036
|
+
* Two kinds of destination. A TikTok pixel (`destinationId` `pixel:<pixelCode>`, as listed by the destinations endpoint) takes website events through the Events API and honours `testCode`. An offline event set (its numeric id) takes in-store, CRM and call-center conversions; each of those events must carry an email or phone.
|
|
21037
21037
|
*
|
|
21038
21038
|
* The connected TikTok ads account must have granted the Offline Events permission; older grants must reconnect.
|
|
21039
21039
|
*
|
|
@@ -21058,6 +21058,8 @@ export const getConversionsQuality = <ThrowOnError extends boolean = false>(opti
|
|
|
21058
21058
|
* - LinkedIn: 5000, all-or-nothing per chunk.
|
|
21059
21059
|
* - OpenAI Ads: 1000 per request. Larger submissions are split into 1000-event chunks, each all-or-nothing (a malformed event fails every event in that chunk, not the whole request).
|
|
21060
21060
|
* - Reddit: works the same way as OpenAI Ads, in chunks of 1000.
|
|
21061
|
+
* - TikTok: 1000. Microsoft: its offline conversion cap per request. X: 500. Other destinations are sent in their platform's own batch size or one event at a time.
|
|
21062
|
+
* - An event a platform would refuse (too old, no usable identifier) is listed in `failures` and the rest of its chunk is still sent, except on Google Ads and OpenAI Ads.
|
|
21061
21063
|
*
|
|
21062
21064
|
* ### Dedup
|
|
21063
21065
|
*
|
|
@@ -21553,6 +21555,12 @@ export const listForwardingRules = <ThrowOnError extends boolean = false>(option
|
|
|
21553
21555
|
*
|
|
21554
21556
|
* Pick `destinationId` from `GET /v1/ads/conversions/destinations`. Set `eventNames` to forward only those events, such as only `Purchase`; leave it out to forward every event.
|
|
21555
21557
|
*
|
|
21558
|
+
* - `eventNameMap` renames events for this destination (send your `Lead` as its `Purchase`).
|
|
21559
|
+
* - `valueOverride` changes the value it gets (a fixed amount or a percent of the event's value).
|
|
21560
|
+
* - `valueCondition` forwards only events above, below or equal to a value.
|
|
21561
|
+
*
|
|
21562
|
+
* Each applies to this rule only: the event is stored, and sent to other rules, as received.
|
|
21563
|
+
*
|
|
21556
21564
|
*/
|
|
21557
21565
|
export const createForwardingRule = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateForwardingRuleData, ThrowOnError>) => {
|
|
21558
21566
|
return (options?.client ?? client).post<CreateForwardingRuleResponse, CreateForwardingRuleError, ThrowOnError>({
|
|
@@ -21562,8 +21570,10 @@ export const createForwardingRule = <ThrowOnError extends boolean = false>(optio
|
|
|
21562
21570
|
};
|
|
21563
21571
|
|
|
21564
21572
|
/**
|
|
21565
|
-
*
|
|
21566
|
-
*
|
|
21573
|
+
* Update a forwarding rule
|
|
21574
|
+
* Changes the fields you send and keeps the others. Send `eventNameMap: null` to stop renaming, `valueOverride: { "mode": "original" }` to send the event's own value again, and `valueCondition: null` to forward whatever the value.
|
|
21575
|
+
*
|
|
21576
|
+
* `apiSecret` replaces the secret of a rule whose destination needs one, such as a Google Analytics data stream's Measurement Protocol API secret. Before saving, Zernio sends one hit to Google's validation server; Google does not confirm the secret itself, so check GA4 Realtime after the next events.
|
|
21567
21577
|
*
|
|
21568
21578
|
*/
|
|
21569
21579
|
export const updateForwardingRule = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateForwardingRuleData, ThrowOnError>) => {
|
|
@@ -13666,9 +13666,54 @@ export type ForwardingRule = {
|
|
|
13666
13666
|
* Only when an `apiSecret` was saved by this request. Google Analytics never confirms a Measurement Protocol API secret, so it is `false` there: the first events in GA4 Realtime prove the secret is right.
|
|
13667
13667
|
*/
|
|
13668
13668
|
apiSecretVerified?: boolean;
|
|
13669
|
+
/**
|
|
13670
|
+
* Renames events for this destination, such as `{ "Lead": "Purchase" }`; null sends every event under its own name.
|
|
13671
|
+
*/
|
|
13672
|
+
eventNameMap?: {
|
|
13673
|
+
[key: string]: (string);
|
|
13674
|
+
} | null;
|
|
13675
|
+
valueOverride?: ForwardingRuleValueOverride;
|
|
13676
|
+
/**
|
|
13677
|
+
* Forwards only events whose value matches; null forwards whatever the value.
|
|
13678
|
+
*/
|
|
13679
|
+
valueCondition?: (ForwardingRuleValueCondition | null);
|
|
13669
13680
|
createdAt?: string;
|
|
13670
13681
|
};
|
|
13671
13682
|
|
|
13683
|
+
/**
|
|
13684
|
+
* Your event name to the name this destination gets, such as `{ "Lead": "Purchase" }`. Names not in the map are sent unchanged.
|
|
13685
|
+
*
|
|
13686
|
+
* A target spelled like a standard event in another case or form (`purchase`, `generate_lead`) is saved as the standard name (`Purchase`, `Lead`), so each platform gets its own standard event.
|
|
13687
|
+
*
|
|
13688
|
+
* `eventNames` and `valueCondition` are checked against the name and value as received, before renaming. The event id is never changed, so deduplication still works.
|
|
13689
|
+
*/
|
|
13690
|
+
export type ForwardingRuleEventNameMap = {
|
|
13691
|
+
[key: string]: (string);
|
|
13692
|
+
};
|
|
13693
|
+
|
|
13694
|
+
/**
|
|
13695
|
+
* Forward only events whose value is greater than (`gt`), less than (`lt`) or equal to (`eq`) `amount`. An event without a value counts as 0. Checked on the value as received, before `valueOverride`.
|
|
13696
|
+
*/
|
|
13697
|
+
export type ForwardingRuleValueCondition = {
|
|
13698
|
+
operator: 'gt' | 'lt' | 'eq';
|
|
13699
|
+
amount: number;
|
|
13700
|
+
};
|
|
13701
|
+
|
|
13702
|
+
export type operator = 'gt' | 'lt' | 'eq';
|
|
13703
|
+
|
|
13704
|
+
/**
|
|
13705
|
+
* The value this destination gets. `original` sends the event's own value; `fixed` sends `amount` for every event; `percent` sends `amount` percent of the event's value (30 sends 30%, rounded to cents), and leaves an event without a value without one. The currency is kept.
|
|
13706
|
+
*/
|
|
13707
|
+
export type ForwardingRuleValueOverride = {
|
|
13708
|
+
mode: 'original' | 'fixed' | 'percent';
|
|
13709
|
+
/**
|
|
13710
|
+
* Required for `fixed` and `percent` (at most 1000 for `percent`); null for `original`.
|
|
13711
|
+
*/
|
|
13712
|
+
amount?: (number) | null;
|
|
13713
|
+
};
|
|
13714
|
+
|
|
13715
|
+
export type mode7 = 'original' | 'fixed' | 'percent';
|
|
13716
|
+
|
|
13672
13717
|
/**
|
|
13673
13718
|
* Why this account, calendar or address could not be read. The provider's code when it gave one.
|
|
13674
13719
|
*/
|
|
@@ -23768,7 +23813,7 @@ export type criteriaType = 'AGE' | 'GENDER' | 'OS_TYPE' | 'DEVICE_PLATFORM' | 'L
|
|
|
23768
23813
|
/**
|
|
23769
23814
|
* Required on every criterion. `CONTAINS` is currently the only value Meta supports.
|
|
23770
23815
|
*/
|
|
23771
|
-
export type
|
|
23816
|
+
export type operator2 = 'CONTAINS';
|
|
23772
23817
|
|
|
23773
23818
|
/**
|
|
23774
23819
|
* A named set of bid-adjustment rules on an ad account. Attach it to an ad set with
|
|
@@ -31165,7 +31210,7 @@ export type XArticle = {
|
|
|
31165
31210
|
/**
|
|
31166
31211
|
* Publish creates an X Article draft and then publishes it. Draft stops after draft creation and returns the X draft ID without a public URL.
|
|
31167
31212
|
*/
|
|
31168
|
-
export type
|
|
31213
|
+
export type mode8 = 'publish' | 'draft';
|
|
31169
31214
|
|
|
31170
31215
|
export type XArticleBlock = {
|
|
31171
31216
|
type: 'unstyled' | 'header-one' | 'header-two' | 'header-three' | 'unordered-list-item' | 'ordered-list-item' | 'blockquote' | 'atomic';
|
|
@@ -80231,7 +80276,7 @@ export type SendConversionsData = {
|
|
|
80231
80276
|
};
|
|
80232
80277
|
|
|
80233
80278
|
export type SendConversionsResponse = ({
|
|
80234
|
-
platform?: 'metaads' | 'googleads' | 'linkedinads' | 'tiktokads' | 'openaiads' | 'pinterestads' | 'redditads';
|
|
80279
|
+
platform?: 'metaads' | 'googleads' | 'linkedinads' | 'tiktokads' | 'openaiads' | 'pinterestads' | 'redditads' | 'applovinads' | 'microsoftads' | 'xads' | 'snapchatads' | 'taboolaads' | 'googleanalytics' | 'klaviyo' | 'attentive' | 'impact' | 'awin' | 'campaignmanager360' | 'tradedeskads' | 'amazonads';
|
|
80235
80280
|
/**
|
|
80236
80281
|
* Events accepted by the platform.
|
|
80237
80282
|
*/
|
|
@@ -80856,7 +80901,7 @@ export type SendEventsResponse = ({
|
|
|
80856
80901
|
destinations?: Array<{
|
|
80857
80902
|
accountId?: string;
|
|
80858
80903
|
destinationId?: string;
|
|
80859
|
-
platform?: 'metaads' | 'googleads' | 'linkedinads' | 'tiktokads' | 'openaiads' | 'pinterestads' | 'redditads';
|
|
80904
|
+
platform?: 'metaads' | 'googleads' | 'linkedinads' | 'tiktokads' | 'openaiads' | 'pinterestads' | 'redditads' | 'applovinads' | 'microsoftads' | 'xads' | 'snapchatads' | 'taboolaads' | 'googleanalytics' | 'klaviyo' | 'attentive' | 'impact' | 'awin' | 'campaignmanager360' | 'tradedeskads' | 'amazonads';
|
|
80860
80905
|
/**
|
|
80861
80906
|
* Events the platform accepted.
|
|
80862
80907
|
*/
|
|
@@ -81593,7 +81638,7 @@ export type GetEventResponse = ({
|
|
|
81593
81638
|
deliveries?: Array<{
|
|
81594
81639
|
accountId?: string;
|
|
81595
81640
|
destinationId?: string;
|
|
81596
|
-
platform?: ('metaads' | 'googleads' | 'linkedinads' | 'tiktokads' | 'openaiads' | 'pinterestads' | 'redditads') | null;
|
|
81641
|
+
platform?: ('metaads' | 'googleads' | 'linkedinads' | 'tiktokads' | 'openaiads' | 'pinterestads' | 'redditads' | 'applovinads' | 'microsoftads' | 'xads' | 'snapchatads' | 'taboolaads' | 'googleanalytics' | 'klaviyo' | 'attentive' | 'impact' | 'awin' | 'campaignmanager360' | 'tradedeskads' | 'amazonads') | null;
|
|
81597
81642
|
/**
|
|
81598
81643
|
* `dropped`: not sent because the visitor did not consent; `errorCode` says why (`consent_denied` or `consent_missing`).
|
|
81599
81644
|
*/
|
|
@@ -81812,6 +81857,9 @@ export type CreateForwardingRuleData = {
|
|
|
81812
81857
|
* Forward only events from these sources, such as only `web` for a tracked website. Leave it out to forward events from every source.
|
|
81813
81858
|
*/
|
|
81814
81859
|
sources?: Array<('api' | 'relay' | 'hubspot' | 'meta_leads' | 'google_leads' | 'linkedin_leads' | 'tiktok_leads' | 'shopify' | 'woocommerce' | 'stripe' | 'web' | 'salesforce' | 'gohighlevel' | 'postback' | 'form_leads')>;
|
|
81860
|
+
eventNameMap?: ForwardingRuleEventNameMap;
|
|
81861
|
+
valueOverride?: ForwardingRuleValueOverride;
|
|
81862
|
+
valueCondition?: ForwardingRuleValueCondition;
|
|
81815
81863
|
/**
|
|
81816
81864
|
* Google Analytics streams only: the stream's Measurement Protocol API secret (GA4 Admin › Data streams). Optional when the connection has edit access, since Zernio then creates it. Checked against Google's validation server, stored encrypted, never returned. Change it with `PATCH /v1/events/forwarding-rules/{ruleId}`.
|
|
81817
81865
|
*/
|
|
@@ -81829,7 +81877,10 @@ export type CreateForwardingRuleError = (ErrorResponse | {
|
|
|
81829
81877
|
|
|
81830
81878
|
export type UpdateForwardingRuleData = {
|
|
81831
81879
|
body: {
|
|
81832
|
-
apiSecret
|
|
81880
|
+
apiSecret?: string;
|
|
81881
|
+
eventNameMap?: (ForwardingRuleEventNameMap | null);
|
|
81882
|
+
valueOverride?: ForwardingRuleValueOverride;
|
|
81883
|
+
valueCondition?: (ForwardingRuleValueCondition | null);
|
|
81833
81884
|
};
|
|
81834
81885
|
path: {
|
|
81835
81886
|
/**
|
|
@@ -82207,7 +82258,7 @@ export type ListAdConversionDestinationsData = {
|
|
|
82207
82258
|
};
|
|
82208
82259
|
|
|
82209
82260
|
export type ListAdConversionDestinationsResponse = ({
|
|
82210
|
-
platform?: 'metaads' | 'googleads' | 'linkedinads' | 'tiktokads' | 'openaiads' | 'pinterestads' | 'redditads';
|
|
82261
|
+
platform?: 'metaads' | 'googleads' | 'linkedinads' | 'tiktokads' | 'openaiads' | 'pinterestads' | 'redditads' | 'applovinads' | 'microsoftads' | 'xads' | 'snapchatads' | 'taboolaads' | 'googleanalytics' | 'klaviyo' | 'attentive' | 'impact' | 'awin' | 'campaignmanager360' | 'tradedeskads' | 'amazonads';
|
|
82211
82262
|
destinations?: Array<{
|
|
82212
82263
|
/**
|
|
82213
82264
|
* Destination identifier. Meta: pixel ID. Google:
|
|
@@ -82649,7 +82700,7 @@ export type ListConversionDestinationsData = {
|
|
|
82649
82700
|
};
|
|
82650
82701
|
|
|
82651
82702
|
export type ListConversionDestinationsResponse = ({
|
|
82652
|
-
platform?: 'metaads' | 'googleads' | 'linkedinads' | 'tiktokads' | 'openaiads' | 'pinterestads' | 'redditads';
|
|
82703
|
+
platform?: 'metaads' | 'googleads' | 'linkedinads' | 'tiktokads' | 'openaiads' | 'pinterestads' | 'redditads' | 'applovinads' | 'microsoftads' | 'xads' | 'snapchatads' | 'taboolaads' | 'googleanalytics' | 'klaviyo' | 'attentive' | 'impact' | 'awin' | 'campaignmanager360' | 'tradedeskads' | 'amazonads';
|
|
82653
82704
|
destinations?: Array<{
|
|
82654
82705
|
/**
|
|
82655
82706
|
* Destination identifier. Meta: pixel ID. Google:
|