import * as _walkeros_core_dev from '@walkeros/core/dev'; import { z } from '@walkeros/core/dev'; import { DestinationWeb } from '@walkeros/web-core'; import { Flow } from '@walkeros/core'; declare const SettingsSchema: z.ZodObject<{ apiKey: z.ZodString; }, z.core.$strip>; type Settings$1 = z.infer; /** * LinkedIn per-rule mapping schema. * * Every field on `conversion` is a walkerOS mapping value (static literal, * string path, or `{ map, value, key, fn, ... }` object). The schema uses * `z.unknown()` for each so users can supply any valid mapping shape — the * destination resolves it via `getMappingValue()` at push time. */ declare const MappingSchema: z.ZodObject<{ conversion: z.ZodOptional; }, z.core.$strip>; type Mapping = z.infer; declare const settings: _walkeros_core_dev.JSONSchema; declare const mapping: _walkeros_core_dev.JSONSchema; type index$1_Mapping = Mapping; declare const index$1_MappingSchema: typeof MappingSchema; declare const index$1_SettingsSchema: typeof SettingsSchema; declare const index$1_mapping: typeof mapping; declare const index$1_settings: typeof settings; declare namespace index$1 { export { type index$1_Mapping as Mapping, index$1_MappingSchema as MappingSchema, type Settings$1 as Settings, index$1_SettingsSchema as SettingsSchema, index$1_mapping as mapping, index$1_settings as settings }; } /** * LinkedIn Insight Tag runtime surface. * * The Insight Tag script installs `window.lintrk` — a single function that * accepts exactly one tracked action: `lintrk('track', data)`. * * Before the script loads, the destination installs a queue-backed shim so * calls made during init are buffered and flushed once the script loads. * This mirrors the pattern LinkedIn's own snippet uses. */ type LintrkAction = 'track'; interface LintrkTrackData { conversion_id: number; conversion_value?: number; currency?: string; event_id?: string; } type Lintrk = ((action: LintrkAction, data: LintrkTrackData) => void) & { /** Internal queue populated before the CDN script loads. */ q?: unknown[]; }; declare global { interface Window { _linkedin_partner_id?: string; _linkedin_data_partner_ids?: string[]; lintrk?: Lintrk; } } /** * Destination-level settings. * * apiKey — the LinkedIn Partner ID (numeric string, e.g. "123456"), assigned * to `window._linkedin_partner_id` before the script loads. * include — event sections made available for mapping resolution. Present for * consistency with other destinations; has no effect at call time * because `lintrk()` only accepts four fixed fields. Kept so users * can reference section-prefixed keys in future custom mapping * strategies without a breaking change. */ interface Settings { apiKey: string; } /** * Env — mock surface for tests and dev. The destination mutates * `window._linkedin_partner_id` / `window._linkedin_data_partner_ids` and * installs `window.lintrk` in init; tests can pre-seed `window.lintrk` with * a spy to skip the script injection path. * * `document` is also mocked so `addScript()` can run headlessly. */ interface Env extends DestinationWeb.Env { window: { _linkedin_partner_id?: string; _linkedin_data_partner_ids?: string[]; lintrk?: Lintrk; }; } /** * Pre-init environment — no LinkedIn state present. The destination's init * will populate _linkedin_partner_id and install the lintrk queue. */ declare const init: Env | undefined; /** * Post-init environment — lintrk is a spy-able no-op function carrying the * queue shape the real script installs. Tests clone this and replace * `window.lintrk` with a jest.fn() before pushing events, so every call is * captured. */ declare const push: Env; /** * Simulation tracking paths — used by CLI `--simulate` to record which * function calls happened during an event push. */ declare const simulation: string[]; declare const env_init: typeof init; declare const env_push: typeof push; declare const env_simulation: typeof simulation; declare namespace env { export { env_init as init, env_push as push, env_simulation as simulation }; } /** * Examples may optionally override destination-level settings for a test. * The test runner reads `settings` from the example and merges it into the * base destination settings (on top of the fixed `apiKey`). Rarely needed * for LinkedIn - conversion config lives on the rule, not destination-level. */ type LinkedInStepExample = Flow.StepExample & { settings?: Partial; }; /** * OPT-IN: Unmapped event is silently ignored. * * LinkedIn's core behavioral difference from analytics destinations: events * without `mapping.settings.conversion` produce ZERO lintrk() calls. The * destination is opt-in - each conversion must reference a pre-created * Conversion Rule from Campaign Manager. */ declare const unmappedEventIgnored: LinkedInStepExample; /** * Simplest possible conversion - just a `conversion_id` from Campaign Manager. * * Form submission → LinkedIn Lead conversion. The mapping resolves `id` as a * literal value (no walker event field needed). The destination translates * `{ id }` → `lintrk('track', { conversion_id })`. */ declare const simpleConversionId: LinkedInStepExample; /** * Full e-commerce conversion - every supported lintrk field populated. * * mapping config uses short walkerOS keys (`id`, `value`, `currency`, `eventId`); * the destination translates them to the vendor parameter names * (`conversion_id`, `conversion_value`, `currency`, `event_id`). * * Currency uses the walkerOS fallback syntax: `{ key, value }` - pull from * `data.currency` first, fall back to `"EUR"` if absent. The default * `order complete` fixture from `getEvent` already sets `data.currency: "EUR"`, * so the resolved value is "EUR" here. * * `eventId` maps from the walkerOS event.id - stable per event, unique, and * ready for deduplication with a future server (Conversions API) destination. */ declare const orderCompleteFullConversion: LinkedInStepExample; /** * Page view as an explicit conversion. * * LinkedIn's Insight Tag automatically fires a page view on load for * retargeting / audience building - that call is NOT something the * destination controls. This example tests the OTHER case: mapping a * specific walkerOS `page view` event to a Campaign Manager KEY_PAGE_VIEW * conversion rule, which fires an EXPLICIT lintrk('track') call in addition * to the auto page view. */ declare const pageViewConversion: LinkedInStepExample; /** * Middle-funnel LEAD conversion - demo request without monetary value. * * LinkedIn's conversion types include LEAD, CONTACT, SIGN_UP, etc. The * destination is agnostic to the type (set in Campaign Manager, not at call * time) - all we forward is the conversion_id. This fixture exercises the * "id + eventId only" shape. */ declare const demoRequestLead: LinkedInStepExample; /** * rule.silent - fully-configured conversion rule temporarily disabled. * * The rule has a valid `conversion.map` but `silent: true` tells the destination * to produce zero calls. This is distinct from the opt-in default (no * `conversion` at all): silent explicitly keeps the rule on disk for quick * reactivation without deleting it. */ declare const conversionSilenced: LinkedInStepExample; /** * Falsy `id` → entire lintrk call is skipped. * * If the resolved conversion object has no truthy `id`, the destination does * NOT call lintrk at all. This protects against misconfigured mappings * (e.g. pulling id from a non-existent field). * * Here we map `id` from `data.nonexistentField` - it resolves to undefined, * so zero calls are produced. */ declare const missingConversionIdIgnored: LinkedInStepExample; /** * Partial conversion - value missing → omitted from the lintrk call. * * The rule asks for `value: 'data.missingTotal'` (undefined), `currency` * (undefined), and `eventId: 'id'` (present). Only `conversion_id` and * `event_id` appear in the final call - no `conversion_value`, no `currency`. */ declare const partialFieldsOmitted: LinkedInStepExample; type step_LinkedInStepExample = LinkedInStepExample; declare const step_conversionSilenced: typeof conversionSilenced; declare const step_demoRequestLead: typeof demoRequestLead; declare const step_missingConversionIdIgnored: typeof missingConversionIdIgnored; declare const step_orderCompleteFullConversion: typeof orderCompleteFullConversion; declare const step_pageViewConversion: typeof pageViewConversion; declare const step_partialFieldsOmitted: typeof partialFieldsOmitted; declare const step_simpleConversionId: typeof simpleConversionId; declare const step_unmappedEventIgnored: typeof unmappedEventIgnored; declare namespace step { export { type step_LinkedInStepExample as LinkedInStepExample, step_conversionSilenced as conversionSilenced, step_demoRequestLead as demoRequestLead, step_missingConversionIdIgnored as missingConversionIdIgnored, step_orderCompleteFullConversion as orderCompleteFullConversion, step_pageViewConversion as pageViewConversion, step_partialFieldsOmitted as partialFieldsOmitted, step_simpleConversionId as simpleConversionId, step_unmappedEventIgnored as unmappedEventIgnored }; } declare const index_env: typeof env; declare const index_step: typeof step; declare namespace index { export { index_env as env, index_step as step }; } export { index as examples, index$1 as schemas };