@walkeros/web-destination-linkedin 3.3.0-next-1776098542393
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/LICENSE +21 -0
- package/README.md +202 -0
- package/dist/dev.d.mts +229 -0
- package/dist/dev.d.ts +229 -0
- package/dist/dev.js +1 -0
- package/dist/dev.js.map +1 -0
- package/dist/dev.mjs +1 -0
- package/dist/dev.mjs.map +1 -0
- package/dist/examples/index.d.mts +191 -0
- package/dist/examples/index.d.ts +191 -0
- package/dist/examples/index.js +14372 -0
- package/dist/examples/index.mjs +14350 -0
- package/dist/index.browser.js +1 -0
- package/dist/index.d.mts +105 -0
- package/dist/index.d.ts +105 -0
- package/dist/index.es5.js +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -0
- package/dist/walkerOS.json +796 -0
- package/package.json +78 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Destination as Destination$1, Mapping as Mapping$1 } from '@walkeros/core';
|
|
2
|
+
import { DestinationWeb } from '@walkeros/web-core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* LinkedIn Insight Tag runtime surface.
|
|
6
|
+
*
|
|
7
|
+
* The Insight Tag script installs `window.lintrk` — a single function that
|
|
8
|
+
* accepts exactly one tracked action: `lintrk('track', data)`.
|
|
9
|
+
*
|
|
10
|
+
* Before the script loads, the destination installs a queue-backed shim so
|
|
11
|
+
* calls made during init are buffered and flushed once the script loads.
|
|
12
|
+
* This mirrors the pattern LinkedIn's own snippet uses.
|
|
13
|
+
*/
|
|
14
|
+
type LintrkAction = 'track';
|
|
15
|
+
interface LintrkTrackData {
|
|
16
|
+
conversion_id: number;
|
|
17
|
+
conversion_value?: number;
|
|
18
|
+
currency?: string;
|
|
19
|
+
event_id?: string;
|
|
20
|
+
}
|
|
21
|
+
type Lintrk = ((action: LintrkAction, data: LintrkTrackData) => void) & {
|
|
22
|
+
/** Internal queue populated before the CDN script loads. */
|
|
23
|
+
q?: unknown[];
|
|
24
|
+
};
|
|
25
|
+
declare global {
|
|
26
|
+
interface Window {
|
|
27
|
+
_linkedin_partner_id?: string;
|
|
28
|
+
_linkedin_data_partner_ids?: string[];
|
|
29
|
+
lintrk?: Lintrk;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Destination-level settings.
|
|
34
|
+
*
|
|
35
|
+
* apiKey — the LinkedIn Partner ID (numeric string, e.g. "123456"), assigned
|
|
36
|
+
* to `window._linkedin_partner_id` before the script loads.
|
|
37
|
+
* include — event sections made available for mapping resolution. Present for
|
|
38
|
+
* consistency with other destinations; has no effect at call time
|
|
39
|
+
* because `lintrk()` only accepts four fixed fields. Kept so users
|
|
40
|
+
* can reference section-prefixed keys in future custom mapping
|
|
41
|
+
* strategies without a breaking change.
|
|
42
|
+
*/
|
|
43
|
+
interface Settings {
|
|
44
|
+
apiKey: string;
|
|
45
|
+
}
|
|
46
|
+
type InitSettings = Partial<Settings>;
|
|
47
|
+
/**
|
|
48
|
+
* Per-rule mapping settings.
|
|
49
|
+
*
|
|
50
|
+
* conversion — mapping value resolving to an object with short keys:
|
|
51
|
+
* { id (required), value?, currency?, eventId? }
|
|
52
|
+
*
|
|
53
|
+
* `id` becomes `conversion_id` (number, Campaign Manager conversion rule ID).
|
|
54
|
+
* Other keys translate 1:1 to the vendor parameter names.
|
|
55
|
+
*
|
|
56
|
+
* Events without a resolved `conversion.id` are silently ignored — LinkedIn
|
|
57
|
+
* is an opt-in conversion model.
|
|
58
|
+
*/
|
|
59
|
+
interface Mapping {
|
|
60
|
+
conversion?: Mapping$1.Value;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Env — mock surface for tests and dev. The destination mutates
|
|
64
|
+
* `window._linkedin_partner_id` / `window._linkedin_data_partner_ids` and
|
|
65
|
+
* installs `window.lintrk` in init; tests can pre-seed `window.lintrk` with
|
|
66
|
+
* a spy to skip the script injection path.
|
|
67
|
+
*
|
|
68
|
+
* `document` is also mocked so `addScript()` can run headlessly.
|
|
69
|
+
*/
|
|
70
|
+
interface Env extends DestinationWeb.Env {
|
|
71
|
+
window: {
|
|
72
|
+
_linkedin_partner_id?: string;
|
|
73
|
+
_linkedin_data_partner_ids?: string[];
|
|
74
|
+
lintrk?: Lintrk;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
type Types = Destination$1.Types<Settings, Mapping, Env, InitSettings>;
|
|
78
|
+
type Destination = DestinationWeb.Destination<Types>;
|
|
79
|
+
type Config = DestinationWeb.Config<Types>;
|
|
80
|
+
interface LinkedInDestination extends Destination {
|
|
81
|
+
env?: Env;
|
|
82
|
+
}
|
|
83
|
+
type Rule = Mapping$1.Rule<Mapping>;
|
|
84
|
+
type Rules = Mapping$1.Rules<Rule>;
|
|
85
|
+
|
|
86
|
+
type index_Config = Config;
|
|
87
|
+
type index_Destination = Destination;
|
|
88
|
+
type index_Env = Env;
|
|
89
|
+
type index_InitSettings = InitSettings;
|
|
90
|
+
type index_LinkedInDestination = LinkedInDestination;
|
|
91
|
+
type index_Lintrk = Lintrk;
|
|
92
|
+
type index_LintrkAction = LintrkAction;
|
|
93
|
+
type index_LintrkTrackData = LintrkTrackData;
|
|
94
|
+
type index_Mapping = Mapping;
|
|
95
|
+
type index_Rule = Rule;
|
|
96
|
+
type index_Rules = Rules;
|
|
97
|
+
type index_Settings = Settings;
|
|
98
|
+
type index_Types = Types;
|
|
99
|
+
declare namespace index {
|
|
100
|
+
export type { index_Config as Config, index_Destination as Destination, index_Env as Env, index_InitSettings as InitSettings, index_LinkedInDestination as LinkedInDestination, index_Lintrk as Lintrk, index_LintrkAction as LintrkAction, index_LintrkTrackData as LintrkTrackData, index_Mapping as Mapping, index_Rule as Rule, index_Rules as Rules, index_Settings as Settings, index_Types as Types };
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
declare const destinationLinkedIn: Destination;
|
|
104
|
+
|
|
105
|
+
export { index as DestinationLinkedIn, destinationLinkedIn as default, destinationLinkedIn };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Destination as Destination$1, Mapping as Mapping$1 } from '@walkeros/core';
|
|
2
|
+
import { DestinationWeb } from '@walkeros/web-core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* LinkedIn Insight Tag runtime surface.
|
|
6
|
+
*
|
|
7
|
+
* The Insight Tag script installs `window.lintrk` — a single function that
|
|
8
|
+
* accepts exactly one tracked action: `lintrk('track', data)`.
|
|
9
|
+
*
|
|
10
|
+
* Before the script loads, the destination installs a queue-backed shim so
|
|
11
|
+
* calls made during init are buffered and flushed once the script loads.
|
|
12
|
+
* This mirrors the pattern LinkedIn's own snippet uses.
|
|
13
|
+
*/
|
|
14
|
+
type LintrkAction = 'track';
|
|
15
|
+
interface LintrkTrackData {
|
|
16
|
+
conversion_id: number;
|
|
17
|
+
conversion_value?: number;
|
|
18
|
+
currency?: string;
|
|
19
|
+
event_id?: string;
|
|
20
|
+
}
|
|
21
|
+
type Lintrk = ((action: LintrkAction, data: LintrkTrackData) => void) & {
|
|
22
|
+
/** Internal queue populated before the CDN script loads. */
|
|
23
|
+
q?: unknown[];
|
|
24
|
+
};
|
|
25
|
+
declare global {
|
|
26
|
+
interface Window {
|
|
27
|
+
_linkedin_partner_id?: string;
|
|
28
|
+
_linkedin_data_partner_ids?: string[];
|
|
29
|
+
lintrk?: Lintrk;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Destination-level settings.
|
|
34
|
+
*
|
|
35
|
+
* apiKey — the LinkedIn Partner ID (numeric string, e.g. "123456"), assigned
|
|
36
|
+
* to `window._linkedin_partner_id` before the script loads.
|
|
37
|
+
* include — event sections made available for mapping resolution. Present for
|
|
38
|
+
* consistency with other destinations; has no effect at call time
|
|
39
|
+
* because `lintrk()` only accepts four fixed fields. Kept so users
|
|
40
|
+
* can reference section-prefixed keys in future custom mapping
|
|
41
|
+
* strategies without a breaking change.
|
|
42
|
+
*/
|
|
43
|
+
interface Settings {
|
|
44
|
+
apiKey: string;
|
|
45
|
+
}
|
|
46
|
+
type InitSettings = Partial<Settings>;
|
|
47
|
+
/**
|
|
48
|
+
* Per-rule mapping settings.
|
|
49
|
+
*
|
|
50
|
+
* conversion — mapping value resolving to an object with short keys:
|
|
51
|
+
* { id (required), value?, currency?, eventId? }
|
|
52
|
+
*
|
|
53
|
+
* `id` becomes `conversion_id` (number, Campaign Manager conversion rule ID).
|
|
54
|
+
* Other keys translate 1:1 to the vendor parameter names.
|
|
55
|
+
*
|
|
56
|
+
* Events without a resolved `conversion.id` are silently ignored — LinkedIn
|
|
57
|
+
* is an opt-in conversion model.
|
|
58
|
+
*/
|
|
59
|
+
interface Mapping {
|
|
60
|
+
conversion?: Mapping$1.Value;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Env — mock surface for tests and dev. The destination mutates
|
|
64
|
+
* `window._linkedin_partner_id` / `window._linkedin_data_partner_ids` and
|
|
65
|
+
* installs `window.lintrk` in init; tests can pre-seed `window.lintrk` with
|
|
66
|
+
* a spy to skip the script injection path.
|
|
67
|
+
*
|
|
68
|
+
* `document` is also mocked so `addScript()` can run headlessly.
|
|
69
|
+
*/
|
|
70
|
+
interface Env extends DestinationWeb.Env {
|
|
71
|
+
window: {
|
|
72
|
+
_linkedin_partner_id?: string;
|
|
73
|
+
_linkedin_data_partner_ids?: string[];
|
|
74
|
+
lintrk?: Lintrk;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
type Types = Destination$1.Types<Settings, Mapping, Env, InitSettings>;
|
|
78
|
+
type Destination = DestinationWeb.Destination<Types>;
|
|
79
|
+
type Config = DestinationWeb.Config<Types>;
|
|
80
|
+
interface LinkedInDestination extends Destination {
|
|
81
|
+
env?: Env;
|
|
82
|
+
}
|
|
83
|
+
type Rule = Mapping$1.Rule<Mapping>;
|
|
84
|
+
type Rules = Mapping$1.Rules<Rule>;
|
|
85
|
+
|
|
86
|
+
type index_Config = Config;
|
|
87
|
+
type index_Destination = Destination;
|
|
88
|
+
type index_Env = Env;
|
|
89
|
+
type index_InitSettings = InitSettings;
|
|
90
|
+
type index_LinkedInDestination = LinkedInDestination;
|
|
91
|
+
type index_Lintrk = Lintrk;
|
|
92
|
+
type index_LintrkAction = LintrkAction;
|
|
93
|
+
type index_LintrkTrackData = LintrkTrackData;
|
|
94
|
+
type index_Mapping = Mapping;
|
|
95
|
+
type index_Rule = Rule;
|
|
96
|
+
type index_Rules = Rules;
|
|
97
|
+
type index_Settings = Settings;
|
|
98
|
+
type index_Types = Types;
|
|
99
|
+
declare namespace index {
|
|
100
|
+
export type { index_Config as Config, index_Destination as Destination, index_Env as Env, index_InitSettings as InitSettings, index_LinkedInDestination as LinkedInDestination, index_Lintrk as Lintrk, index_LintrkAction as LintrkAction, index_LintrkTrackData as LintrkTrackData, index_Mapping as Mapping, index_Rule as Rule, index_Rules as Rules, index_Settings as Settings, index_Types as Types };
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
declare const destinationLinkedIn: Destination;
|
|
104
|
+
|
|
105
|
+
export { index as DestinationLinkedIn, destinationLinkedIn as default, destinationLinkedIn };
|