@zernio/node 0.2.122 → 0.2.124

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.
@@ -790,6 +790,48 @@ export type BusinessCenter = {
790
790
  advertiserCount?: (number) | null;
791
791
  };
792
792
 
793
+ /**
794
+ * A discoverable conversion destination on an ad platform — a Meta pixel,
795
+ * Google conversion action, or LinkedIn conversion rule. Returned by
796
+ * `listConversionDestinations`, `getConversionDestination`,
797
+ * `createConversionDestination`, and `updateConversionDestination`.
798
+ *
799
+ */
800
+ export type ConversionDestination = {
801
+ /**
802
+ * Platform-native identifier. Pass back as `destinationId` on event
803
+ * send and as the path segment on CRUD endpoints.
804
+ *
805
+ */
806
+ id: string;
807
+ name: string;
808
+ /**
809
+ * Present when the platform locks the event type/category to the
810
+ * destination (Google conversion actions, LinkedIn conversion rules).
811
+ * Absent for Meta pixels (which accept any event name per request).
812
+ *
813
+ */
814
+ type?: string;
815
+ /**
816
+ * For LinkedIn, `inactive` means the rule is soft-deleted (`enabled: false`).
817
+ *
818
+ */
819
+ status?: 'active' | 'inactive';
820
+ /**
821
+ * Set by adapters whose destinations are scoped to a specific ad
822
+ * account (LinkedIn). Pass back on subsequent CRUD calls to
823
+ * identify the parent ad account.
824
+ *
825
+ */
826
+ adAccountId?: string;
827
+ };
828
+
829
+ /**
830
+ * For LinkedIn, `inactive` means the rule is soft-deleted (`enabled: false`).
831
+ *
832
+ */
833
+ export type status2 = 'active' | 'inactive';
834
+
793
835
  /**
794
836
  * A single conversion event to relay to the ad platform. All PII fields
795
837
  * (email, phone, names) are hashed with SHA-256 server-side using each
@@ -802,7 +844,12 @@ export type ConversionEvent = {
802
844
  * Standard event name (Purchase, Lead, CompleteRegistration, AddToCart,
803
845
  * InitiateCheckout, AddPaymentInfo, Subscribe, StartTrial, ViewContent,
804
846
  * Search, Contact, SubmitApplication, Schedule) or a custom string
805
- * (only supported on platforms that accept custom events).
847
+ * (only supported on platforms that accept custom events — Meta).
848
+ *
849
+ * Per-platform behavior:
850
+ * - Meta: free-form; standard names match Meta's built-ins.
851
+ * - Google: ignored — the conversion action's category determines the type.
852
+ * - LinkedIn: ignored — the conversion rule's `type` is locked to the destination.
806
853
  *
807
854
  */
808
855
  eventName: string;
@@ -812,8 +859,10 @@ export type ConversionEvent = {
812
859
  eventTime: number;
813
860
  /**
814
861
  * Unique dedup key. The same eventId must be used on pixel + CAPI
815
- * to prevent double-counting. Mapped to event_id on Meta and
816
- * transactionId on Google.
862
+ * to prevent double-counting. Mapped to event_id on Meta,
863
+ * transactionId on Google, eventId on LinkedIn (LinkedIn deduplicates
864
+ * against Insight Tag events with the same eventId; the Insight Tag
865
+ * event wins when both arrive).
817
866
  *
818
867
  */
819
868
  eventId: string;
@@ -846,7 +895,11 @@ export type ConversionEvent = {
846
895
  */
847
896
  lastName?: string;
848
897
  /**
849
- * Stable customer identifier (e.g. CRM user ID). Hashed server-side.
898
+ * Stable customer identifier (e.g. CRM user ID). Hashed
899
+ * server-side for Meta and Google. Sent as plaintext to LinkedIn
900
+ * (LinkedIn's Conversions API spec requires the raw value).
901
+ * Maximum effective list size on LinkedIn is 1.
902
+ *
850
903
  */
851
904
  externalId?: string;
852
905
  /**
@@ -885,6 +938,16 @@ export type ConversionEvent = {
885
938
  * Google iOS 14.5+ web-to-app attribution ID.
886
939
  */
887
940
  wbraid?: string;
941
+ /**
942
+ * LinkedIn first-party ad tracking click ID. Captured by
943
+ * parsing `li_fat_id` from landing-page URLs after the
944
+ * advertiser enables enhanced conversion tracking on the
945
+ * LinkedIn Insight Tag. Sent to LinkedIn as the
946
+ * LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID userId. Opaque
947
+ * token, not hashed.
948
+ *
949
+ */
950
+ li_fat_id?: string;
888
951
  };
889
952
  };
890
953
  /**
@@ -1337,7 +1400,7 @@ export type InboxWebhookConversation = {
1337
1400
  status: 'active' | 'archived';
1338
1401
  };
1339
1402
 
1340
- export type status2 = 'active' | 'archived';
1403
+ export type status3 = 'active' | 'archived';
1341
1404
 
1342
1405
  /**
1343
1406
  * The message object included in inbox webhook payloads.
@@ -1867,7 +1930,7 @@ export type PlatformAnalytics = {
1867
1930
  errorMessage?: (string) | null;
1868
1931
  };
1869
1932
 
1870
- export type status3 = 'published' | 'failed';
1933
+ export type status4 = 'published' | 'failed';
1871
1934
 
1872
1935
  /**
1873
1936
  * Sync state of analytics for this platform
@@ -1977,7 +2040,7 @@ export type Post = {
1977
2040
  updatedAt?: string;
1978
2041
  };
1979
2042
 
1980
- export type status4 = 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
2043
+ export type status5 = 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
1981
2044
 
1982
2045
  export type visibility = 'public' | 'private' | 'unlisted';
1983
2046
 
@@ -2644,7 +2707,7 @@ export type UploadTokenResponse = {
2644
2707
  status?: 'pending' | 'completed' | 'expired';
2645
2708
  };
2646
2709
 
2647
- export type status5 = 'pending' | 'completed' | 'expired';
2710
+ export type status6 = 'pending' | 'completed' | 'expired';
2648
2711
 
2649
2712
  export type UploadTokenStatusResponse = {
2650
2713
  token?: string;
@@ -2954,7 +3017,7 @@ export type event = 'account.ads.initial_sync_completed';
2954
3017
  /**
2955
3018
  * Overall outcome of the initial sync.
2956
3019
  */
2957
- export type status6 = 'success' | 'failure';
3020
+ export type status7 = 'success' | 'failure';
2958
3021
 
2959
3022
  /**
2960
3023
  * Stable category for UX branching. New values may be added; existing ones are
@@ -14626,23 +14689,26 @@ export type AddUsersToAdAudienceError = (unknown | {
14626
14689
  export type SendConversionsData = {
14627
14690
  body: {
14628
14691
  /**
14629
- * SocialAccount ID (metaads or googleads).
14692
+ * SocialAccount ID (metaads, googleads, or linkedinads).
14630
14693
  */
14631
14694
  accountId: string;
14632
14695
  /**
14633
14696
  * Platform destination identifier. For Meta, the pixel/dataset
14634
- * ID. For Google, the conversion action resource name.
14697
+ * ID. For Google, the conversion action resource name. For
14698
+ * LinkedIn, the conversion rule ID or full
14699
+ * `urn:lla:llaPartnerConversion:{id}` URN.
14635
14700
  *
14636
14701
  */
14637
14702
  destinationId: string;
14638
14703
  events: Array<ConversionEvent>;
14639
14704
  /**
14640
- * Meta `test_event_code` passthrough. Ignored by Google.
14705
+ * Meta `test_event_code` passthrough. Ignored by Google and LinkedIn.
14641
14706
  */
14642
14707
  testCode?: string;
14643
14708
  /**
14644
14709
  * Batch-level user consent. Required by Google for EEA/UK
14645
- * events under the Feb 2026 restrictions. Ignored by Meta.
14710
+ * events under the Feb 2026 restrictions. Ignored by Meta
14711
+ * and LinkedIn.
14646
14712
  *
14647
14713
  */
14648
14714
  consent?: {
@@ -14653,7 +14719,7 @@ export type SendConversionsData = {
14653
14719
  };
14654
14720
 
14655
14721
  export type SendConversionsResponse = ({
14656
- platform?: 'metaads' | 'googleads';
14722
+ platform?: 'metaads' | 'googleads' | 'linkedinads';
14657
14723
  /**
14658
14724
  * Events accepted by the platform.
14659
14725
  */
@@ -14675,7 +14741,10 @@ export type SendConversionsResponse = ({
14675
14741
  code?: (string | number);
14676
14742
  }>;
14677
14743
  /**
14678
- * Platform trace ID (fbtrace_id for Meta, requestId for Google) for debugging.
14744
+ * Platform trace ID for debugging. fbtrace_id for Meta,
14745
+ * requestId for Google. Absent for LinkedIn (LinkedIn's
14746
+ * conversionEvents endpoint does not surface a trace ID).
14747
+ *
14679
14748
  */
14680
14749
  traceId?: string;
14681
14750
  });
@@ -14687,29 +14756,38 @@ export type SendConversionsError = (unknown | {
14687
14756
  export type ListConversionDestinationsData = {
14688
14757
  path: {
14689
14758
  /**
14690
- * SocialAccount ID (metaads or googleads).
14759
+ * SocialAccount ID (metaads, googleads, or linkedinads).
14691
14760
  */
14692
14761
  accountId: string;
14693
14762
  };
14694
14763
  };
14695
14764
 
14696
14765
  export type ListConversionDestinationsResponse = ({
14697
- platform?: 'metaads' | 'googleads';
14766
+ platform?: 'metaads' | 'googleads' | 'linkedinads';
14698
14767
  destinations?: Array<{
14699
14768
  /**
14700
14769
  * Destination identifier. Meta: pixel ID. Google:
14701
- * conversion action resource name.
14770
+ * conversion action resource name. LinkedIn:
14771
+ * numeric conversion rule ID.
14702
14772
  *
14703
14773
  */
14704
14774
  id?: string;
14705
14775
  name?: string;
14706
14776
  /**
14707
14777
  * Present when the platform locks event type to the
14708
- * destination (Google conversion actions).
14778
+ * destination (Google conversion actions, LinkedIn
14779
+ * conversion rules).
14709
14780
  *
14710
14781
  */
14711
14782
  type?: string;
14712
14783
  status?: 'active' | 'inactive';
14784
+ /**
14785
+ * Set by adapters whose destinations are scoped to a
14786
+ * specific ad account (LinkedIn). Pass back on
14787
+ * subsequent CRUD calls.
14788
+ *
14789
+ */
14790
+ adAccountId?: string;
14713
14791
  }>;
14714
14792
  });
14715
14793
 
@@ -14717,6 +14795,303 @@ export type ListConversionDestinationsError = (unknown | {
14717
14795
  error?: string;
14718
14796
  });
14719
14797
 
14798
+ export type CreateConversionDestinationData = {
14799
+ body: {
14800
+ /**
14801
+ * Sponsored ad account ID. Numeric (e.g. "5123456") or
14802
+ * full `urn:li:sponsoredAccount:{id}` URN.
14803
+ *
14804
+ */
14805
+ adAccountId: string;
14806
+ name: string;
14807
+ /**
14808
+ * Either a unified standard event name (e.g. "Purchase",
14809
+ * "Lead", "AddToCart") or a LinkedIn rule type enum value
14810
+ * (e.g. "PURCHASE", "QUALIFIED_LEAD"). The API maps
14811
+ * standard names to LinkedIn enum values automatically.
14812
+ *
14813
+ */
14814
+ type: string;
14815
+ attributionType?: 'LAST_TOUCH_BY_CAMPAIGN' | 'LAST_TOUCH_BY_CONVERSION';
14816
+ /**
14817
+ * Default 30. 365 only allowed for LEAD, PURCHASE,
14818
+ * ADD_TO_CART, QUALIFIED_LEAD, SUBMIT_APPLICATION rule
14819
+ * types — the API rejects other combinations locally.
14820
+ *
14821
+ */
14822
+ postClickAttributionWindowSize?: 1 | 7 | 30 | 90 | 365;
14823
+ /**
14824
+ * Default 7. Same 365-day-window type restriction applies
14825
+ * as `postClickAttributionWindowSize`.
14826
+ *
14827
+ */
14828
+ viewThroughAttributionWindowSize?: 1 | 7 | 30 | 90 | 365;
14829
+ /**
14830
+ * DYNAMIC (default) uses the per-event `value` from
14831
+ * `sendConversions`. FIXED uses the rule's `value` field.
14832
+ * NO_VALUE drops monetary value entirely.
14833
+ *
14834
+ */
14835
+ valueType?: 'DYNAMIC' | 'FIXED' | 'NO_VALUE';
14836
+ /**
14837
+ * Static conversion value. Used when `valueType=FIXED`.
14838
+ * The currency should match the ad account's currency.
14839
+ *
14840
+ */
14841
+ value?: {
14842
+ /**
14843
+ * ISO 4217 (e.g. "USD").
14844
+ */
14845
+ currencyCode: string;
14846
+ /**
14847
+ * Decimal string (e.g. "49.99").
14848
+ */
14849
+ amount: string;
14850
+ };
14851
+ /**
14852
+ * Controls campaign association at rule-creation time:
14853
+ * - ALL_CAMPAIGNS: associate the rule with every active,
14854
+ * paused, and draft campaign in the ad account
14855
+ * - OBJECTIVE_BASED: associate only campaigns whose
14856
+ * objective matches the rule's type
14857
+ * - NONE: don't auto-associate. Manage associations via
14858
+ * the `/associations` endpoints below.
14859
+ * Note: auto-association runs once at create time; new
14860
+ * campaigns added after the rule still need explicit
14861
+ * association.
14862
+ *
14863
+ */
14864
+ autoAssociationType?: 'ALL_CAMPAIGNS' | 'OBJECTIVE_BASED' | 'NONE';
14865
+ };
14866
+ path: {
14867
+ /**
14868
+ * SocialAccount ID (linkedinads).
14869
+ */
14870
+ accountId: string;
14871
+ };
14872
+ };
14873
+
14874
+ export type CreateConversionDestinationResponse = ({
14875
+ platform?: 'linkedinads';
14876
+ destination?: ConversionDestination;
14877
+ });
14878
+
14879
+ export type CreateConversionDestinationError = (unknown | {
14880
+ error?: string;
14881
+ });
14882
+
14883
+ export type GetConversionDestinationData = {
14884
+ path: {
14885
+ accountId: string;
14886
+ destinationId: string;
14887
+ };
14888
+ query: {
14889
+ /**
14890
+ * Numeric ID or full `urn:li:sponsoredAccount:{id}` URN.
14891
+ */
14892
+ adAccountId: string;
14893
+ };
14894
+ };
14895
+
14896
+ export type GetConversionDestinationResponse = ({
14897
+ platform?: 'linkedinads';
14898
+ destination?: ConversionDestination;
14899
+ });
14900
+
14901
+ export type GetConversionDestinationError = (unknown | {
14902
+ error?: string;
14903
+ });
14904
+
14905
+ export type UpdateConversionDestinationData = {
14906
+ body: {
14907
+ adAccountId: string;
14908
+ name?: string;
14909
+ /**
14910
+ * Setting `false` is equivalent to calling DELETE — the
14911
+ * rule will appear as `inactive` afterwards.
14912
+ *
14913
+ */
14914
+ enabled?: boolean;
14915
+ attributionType?: 'LAST_TOUCH_BY_CAMPAIGN' | 'LAST_TOUCH_BY_CONVERSION';
14916
+ /**
14917
+ * 365 only allowed for LEAD, PURCHASE, ADD_TO_CART,
14918
+ * QUALIFIED_LEAD, SUBMIT_APPLICATION rule types.
14919
+ *
14920
+ */
14921
+ postClickAttributionWindowSize?: 1 | 7 | 30 | 90 | 365;
14922
+ /**
14923
+ * 365 only allowed for LEAD, PURCHASE, ADD_TO_CART,
14924
+ * QUALIFIED_LEAD, SUBMIT_APPLICATION rule types.
14925
+ *
14926
+ */
14927
+ viewThroughAttributionWindowSize?: 1 | 7 | 30 | 90 | 365;
14928
+ valueType?: 'DYNAMIC' | 'FIXED' | 'NO_VALUE';
14929
+ /**
14930
+ * Used when `valueType=FIXED`.
14931
+ */
14932
+ value?: {
14933
+ /**
14934
+ * ISO 4217.
14935
+ */
14936
+ currencyCode?: string;
14937
+ /**
14938
+ * Decimal string (e.g. "49.99").
14939
+ */
14940
+ amount?: string;
14941
+ };
14942
+ };
14943
+ path: {
14944
+ accountId: string;
14945
+ destinationId: string;
14946
+ };
14947
+ };
14948
+
14949
+ export type UpdateConversionDestinationResponse = ({
14950
+ platform?: 'linkedinads';
14951
+ destination?: ConversionDestination;
14952
+ });
14953
+
14954
+ export type UpdateConversionDestinationError = (unknown | {
14955
+ error?: string;
14956
+ });
14957
+
14958
+ export type DeleteConversionDestinationData = {
14959
+ path: {
14960
+ accountId: string;
14961
+ destinationId: string;
14962
+ };
14963
+ query?: {
14964
+ /**
14965
+ * Required as query OR in JSON body.
14966
+ */
14967
+ adAccountId?: string;
14968
+ };
14969
+ };
14970
+
14971
+ export type DeleteConversionDestinationResponse = (void);
14972
+
14973
+ export type DeleteConversionDestinationError = (unknown | {
14974
+ error?: string;
14975
+ });
14976
+
14977
+ export type ListConversionAssociationsData = {
14978
+ path: {
14979
+ accountId: string;
14980
+ destinationId: string;
14981
+ };
14982
+ query: {
14983
+ adAccountId: string;
14984
+ };
14985
+ };
14986
+
14987
+ export type ListConversionAssociationsResponse = ({
14988
+ platform?: 'linkedinads';
14989
+ associations?: Array<{
14990
+ campaignId?: string;
14991
+ conversionId?: string;
14992
+ /**
14993
+ * Epoch ms.
14994
+ */
14995
+ associatedAt?: number;
14996
+ }>;
14997
+ });
14998
+
14999
+ export type ListConversionAssociationsError = (unknown | {
15000
+ error?: string;
15001
+ });
15002
+
15003
+ export type AddConversionAssociationsData = {
15004
+ body: {
15005
+ adAccountId: string;
15006
+ campaignIds: Array<(string)>;
15007
+ };
15008
+ path: {
15009
+ accountId: string;
15010
+ destinationId: string;
15011
+ };
15012
+ };
15013
+
15014
+ export type AddConversionAssociationsResponse = ({
15015
+ platform?: 'linkedinads';
15016
+ /**
15017
+ * Numeric campaign IDs that were successfully associated.
15018
+ */
15019
+ succeeded?: Array<(string)>;
15020
+ failed?: Array<{
15021
+ campaignId?: string;
15022
+ reason?: string;
15023
+ }>;
15024
+ });
15025
+
15026
+ export type AddConversionAssociationsError = (unknown | {
15027
+ error?: string;
15028
+ });
15029
+
15030
+ export type RemoveConversionAssociationsData = {
15031
+ path: {
15032
+ accountId: string;
15033
+ destinationId: string;
15034
+ };
15035
+ query: {
15036
+ adAccountId: string;
15037
+ /**
15038
+ * Comma-separated list of campaign IDs.
15039
+ */
15040
+ campaignIds: string;
15041
+ };
15042
+ };
15043
+
15044
+ export type RemoveConversionAssociationsResponse = ({
15045
+ platform?: 'linkedinads';
15046
+ /**
15047
+ * Numeric campaign IDs that were successfully removed.
15048
+ */
15049
+ succeeded?: Array<(string)>;
15050
+ failed?: Array<{
15051
+ campaignId?: string;
15052
+ reason?: string;
15053
+ }>;
15054
+ });
15055
+
15056
+ export type RemoveConversionAssociationsError = (unknown | {
15057
+ error?: string;
15058
+ });
15059
+
15060
+ export type GetConversionMetricsData = {
15061
+ path: {
15062
+ accountId: string;
15063
+ destinationId: string;
15064
+ };
15065
+ query: {
15066
+ adAccountId: string;
15067
+ endDate?: string;
15068
+ granularity?: 'ALL' | 'DAILY' | 'MONTHLY' | 'YEARLY';
15069
+ startDate: string;
15070
+ };
15071
+ };
15072
+
15073
+ export type GetConversionMetricsResponse = ({
15074
+ platform?: 'linkedinads';
15075
+ granularity?: 'ALL' | 'DAILY' | 'MONTHLY' | 'YEARLY';
15076
+ rows?: Array<{
15077
+ /**
15078
+ * YYYY-MM-DD
15079
+ */
15080
+ start?: string;
15081
+ /**
15082
+ * YYYY-MM-DD (inclusive)
15083
+ */
15084
+ end?: string;
15085
+ metrics?: {
15086
+ [key: string]: (number | string);
15087
+ };
15088
+ }>;
15089
+ });
15090
+
15091
+ export type GetConversionMetricsError = (unknown | {
15092
+ error?: string;
15093
+ });
15094
+
14720
15095
  export type SendWhatsAppConversionData = {
14721
15096
  body: {
14722
15097
  /**