@getlatedev/node 0.2.1733 → 0.2.1734

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.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.1733",
39
+ version: "0.2.1734",
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.1733",
8
+ version: "0.2.1734",
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.1733",
3
+ "version": "0.2.1734",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -21553,6 +21553,12 @@ export const listForwardingRules = <ThrowOnError extends boolean = false>(option
21553
21553
  *
21554
21554
  * 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
21555
  *
21556
+ * - `eventNameMap` renames events for this destination (send your `Lead` as its `Purchase`).
21557
+ * - `valueOverride` changes the value it gets (a fixed amount or a percent of the event's value).
21558
+ * - `valueCondition` forwards only events above, below or equal to a value.
21559
+ *
21560
+ * Each applies to this rule only: the event is stored, and sent to other rules, as received.
21561
+ *
21556
21562
  */
21557
21563
  export const createForwardingRule = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateForwardingRuleData, ThrowOnError>) => {
21558
21564
  return (options?.client ?? client).post<CreateForwardingRuleResponse, CreateForwardingRuleError, ThrowOnError>({
@@ -21562,8 +21568,10 @@ export const createForwardingRule = <ThrowOnError extends boolean = false>(optio
21562
21568
  };
21563
21569
 
21564
21570
  /**
21565
- * Change a forwarding rule's API secret
21566
- * Replaces the `apiSecret` 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.
21571
+ * Update a forwarding rule
21572
+ * 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.
21573
+ *
21574
+ * `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
21575
  *
21568
21576
  */
21569
21577
  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 operator = 'CONTAINS';
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 mode7 = 'publish' | 'draft';
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';
@@ -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: string;
81880
+ apiSecret?: string;
81881
+ eventNameMap?: (ForwardingRuleEventNameMap | null);
81882
+ valueOverride?: ForwardingRuleValueOverride;
81883
+ valueCondition?: (ForwardingRuleValueCondition | null);
81833
81884
  };
81834
81885
  path: {
81835
81886
  /**