@c15t/scripts 2.0.1 → 2.2.0-canary-20260727202135
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/AGENTS.md +62 -0
- package/README.md +41 -29
- package/dist/e2e-test-utils.cjs +51 -10
- package/dist/e2e-test-utils.js +37 -3
- package/dist/engine/compile.cjs +9 -5
- package/dist/engine/runtime.cjs +111 -17
- package/dist/engine/runtime.js +102 -12
- package/dist/registry.cjs +423 -0
- package/dist/registry.js +372 -0
- package/dist/resolve.cjs +9 -5
- package/dist/types.cjs +32 -10
- package/dist/types.js +10 -1
- package/dist/vendors/_shared/attributes.cjs +55 -0
- package/dist/vendors/_shared/attributes.js +14 -0
- package/dist/vendors/_shared/google-consent.cjs +69 -0
- package/dist/vendors/_shared/google-consent.js +27 -0
- package/dist/vendors/_shared/install-builders.cjs +59 -0
- package/dist/vendors/_shared/install-builders.js +21 -0
- package/dist/vendors/_shared/script-url.cjs +78 -0
- package/dist/vendors/_shared/script-url.js +28 -0
- package/dist/{linkedin-insights.cjs → vendors/ads-and-pixels/linkedin-insights.cjs} +11 -7
- package/dist/{linkedin-insights.js → vendors/ads-and-pixels/linkedin-insights.js} +2 -2
- package/dist/vendors/ads-and-pixels/meta-pixel.cjs +206 -0
- package/dist/vendors/ads-and-pixels/meta-pixel.js +153 -0
- package/dist/{microsoft-uet.cjs → vendors/ads-and-pixels/microsoft-uet.cjs} +42 -21
- package/dist/{microsoft-uet.js → vendors/ads-and-pixels/microsoft-uet.js} +31 -14
- package/dist/vendors/ads-and-pixels/reddit-pixel.cjs +151 -0
- package/dist/vendors/ads-and-pixels/reddit-pixel.js +107 -0
- package/dist/vendors/ads-and-pixels/snapchat-pixel.cjs +131 -0
- package/dist/vendors/ads-and-pixels/snapchat-pixel.js +87 -0
- package/dist/{tiktok-pixel.cjs → vendors/ads-and-pixels/tiktok-pixel.cjs} +11 -7
- package/dist/{tiktok-pixel.js → vendors/ads-and-pixels/tiktok-pixel.js} +2 -2
- package/dist/{x-pixel.cjs → vendors/ads-and-pixels/x-pixel.cjs} +15 -8
- package/dist/{x-pixel.js → vendors/ads-and-pixels/x-pixel.js} +6 -3
- package/dist/vendors/analytics/adobe-analytics.cjs +90 -0
- package/dist/vendors/analytics/adobe-analytics.js +49 -0
- package/dist/vendors/analytics/ahrefs-analytics.cjs +68 -0
- package/dist/vendors/analytics/ahrefs-analytics.js +27 -0
- package/dist/vendors/analytics/amplitude.cjs +193 -0
- package/dist/vendors/analytics/amplitude.js +134 -0
- package/dist/vendors/analytics/clearbit.cjs +69 -0
- package/dist/vendors/analytics/clearbit.js +28 -0
- package/dist/vendors/analytics/cloudflare-web-analytics.cjs +73 -0
- package/dist/vendors/analytics/cloudflare-web-analytics.js +32 -0
- package/dist/{databuddy.cjs → vendors/analytics/databuddy.cjs} +14 -10
- package/dist/{databuddy.js → vendors/analytics/databuddy.js} +3 -3
- package/dist/vendors/analytics/fathom-analytics.cjs +76 -0
- package/dist/vendors/analytics/fathom-analytics.js +35 -0
- package/dist/{google-tag.cjs → vendors/analytics/google-tag.cjs} +18 -35
- package/dist/{google-tag.js → vendors/analytics/google-tag.js} +7 -28
- package/dist/vendors/analytics/heap.cjs +181 -0
- package/dist/vendors/analytics/heap.js +134 -0
- package/dist/vendors/analytics/hightouch.cjs +153 -0
- package/dist/vendors/analytics/hightouch.js +109 -0
- package/dist/vendors/analytics/hotjar.cjs +85 -0
- package/dist/vendors/analytics/hotjar.js +44 -0
- package/dist/vendors/analytics/logrocket.cjs +99 -0
- package/dist/vendors/analytics/logrocket.js +58 -0
- package/dist/vendors/analytics/matomo-analytics.cjs +232 -0
- package/dist/vendors/analytics/matomo-analytics.js +191 -0
- package/dist/vendors/analytics/microsoft-clarity.cjs +138 -0
- package/dist/vendors/analytics/microsoft-clarity.js +97 -0
- package/dist/vendors/analytics/mixpanel-analytics.cjs +134 -0
- package/dist/vendors/analytics/mixpanel-analytics.js +93 -0
- package/dist/vendors/analytics/pirsch.cjs +108 -0
- package/dist/vendors/analytics/pirsch.js +67 -0
- package/dist/vendors/analytics/plausible-analytics.cjs +122 -0
- package/dist/vendors/analytics/plausible-analytics.js +81 -0
- package/dist/vendors/analytics/posthog.cjs +204 -0
- package/dist/vendors/analytics/posthog.js +163 -0
- package/dist/vendors/analytics/promptwatch.cjs +70 -0
- package/dist/vendors/analytics/promptwatch.js +29 -0
- package/dist/vendors/analytics/rudderstack.cjs +227 -0
- package/dist/vendors/analytics/rudderstack.js +183 -0
- package/dist/vendors/analytics/rybbit-analytics.cjs +104 -0
- package/dist/vendors/analytics/rybbit-analytics.js +63 -0
- package/dist/vendors/analytics/segment.cjs +97 -0
- package/dist/vendors/analytics/segment.js +56 -0
- package/dist/vendors/analytics/umami-analytics.cjs +80 -0
- package/dist/vendors/analytics/umami-analytics.js +39 -0
- package/dist/vendors/analytics/vercel-analytics.cjs +94 -0
- package/dist/vendors/analytics/vercel-analytics.js +53 -0
- package/dist/vendors/functional/crisp.cjs +143 -0
- package/dist/vendors/functional/crisp.js +102 -0
- package/dist/vendors/functional/intercom.cjs +89 -0
- package/dist/vendors/functional/intercom.js +45 -0
- package/dist/{google-tag-manager.cjs → vendors/tag-managers/google-tag-manager.cjs} +17 -34
- package/dist/{google-tag-manager.js → vendors/tag-managers/google-tag-manager.js} +6 -27
- package/dist-types/__tests__/helpers.d.ts +141 -0
- package/dist-types/engine/runtime.d.ts +1 -1
- package/dist-types/registry.d.ts +440 -0
- package/dist-types/types.d.ts +53 -2
- package/dist-types/vendors/_shared/attributes.d.ts +35 -0
- package/dist-types/vendors/_shared/google-consent.d.ts +47 -0
- package/dist-types/vendors/_shared/install-builders.d.ts +30 -0
- package/dist-types/vendors/_shared/script-url.d.ts +75 -0
- package/dist-types/vendors/ads-and-pixels/linkedin-insights.d.ts +92 -0
- package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +289 -0
- package/dist-types/{microsoft-uet.d.ts → vendors/ads-and-pixels/microsoft-uet.d.ts} +45 -34
- package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +211 -0
- package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +171 -0
- package/dist-types/{tiktok-pixel.d.ts → vendors/ads-and-pixels/tiktok-pixel.d.ts} +48 -33
- package/dist-types/{x-pixel.d.ts → vendors/ads-and-pixels/x-pixel.d.ts} +34 -17
- package/dist-types/vendors/analytics/adobe-analytics.d.ts +75 -0
- package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +62 -0
- package/dist-types/vendors/analytics/amplitude.d.ts +234 -0
- package/dist-types/vendors/analytics/clearbit.d.ts +60 -0
- package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +67 -0
- package/dist-types/{databuddy.d.ts → vendors/analytics/databuddy.d.ts} +25 -25
- package/dist-types/vendors/analytics/fathom-analytics.d.ts +90 -0
- package/dist-types/{google-tag.d.ts → vendors/analytics/google-tag.d.ts} +21 -24
- package/dist-types/vendors/analytics/heap.d.ts +316 -0
- package/dist-types/vendors/analytics/hightouch.d.ts +285 -0
- package/dist-types/vendors/analytics/hotjar.d.ts +73 -0
- package/dist-types/vendors/analytics/logrocket.d.ts +101 -0
- package/dist-types/vendors/analytics/matomo-analytics.d.ts +41 -0
- package/dist-types/vendors/analytics/microsoft-clarity.d.ts +98 -0
- package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +113 -0
- package/dist-types/vendors/analytics/pirsch.d.ts +96 -0
- package/dist-types/vendors/analytics/plausible-analytics.d.ts +122 -0
- package/dist-types/vendors/analytics/posthog.d.ts +154 -0
- package/dist-types/vendors/analytics/promptwatch.d.ts +36 -0
- package/dist-types/vendors/analytics/rudderstack.d.ts +330 -0
- package/dist-types/vendors/analytics/rybbit-analytics.d.ts +82 -0
- package/dist-types/vendors/analytics/segment.d.ts +158 -0
- package/dist-types/vendors/analytics/umami-analytics.d.ts +93 -0
- package/dist-types/vendors/analytics/vercel-analytics.d.ts +66 -0
- package/dist-types/vendors/functional/crisp.d.ts +78 -0
- package/dist-types/vendors/functional/intercom.d.ts +135 -0
- package/dist-types/{google-tag-manager.d.ts → vendors/tag-managers/google-tag-manager.d.ts} +22 -25
- package/docs/README.md +62 -0
- package/docs/frameworks/javascript/script-loader.md +354 -0
- package/docs/frameworks/next/script-loader.md +499 -0
- package/docs/frameworks/react/script-loader.md +553 -0
- package/docs/integrations/adobe-analytics.md +160 -0
- package/docs/integrations/ahrefs-analytics.md +157 -0
- package/docs/integrations/amplitude.md +230 -0
- package/docs/integrations/building-integrations.md +239 -0
- package/docs/integrations/clearbit.md +130 -0
- package/docs/integrations/cloudflare-web-analytics.md +126 -0
- package/docs/integrations/crisp.md +140 -0
- package/docs/integrations/databuddy.md +205 -0
- package/docs/integrations/fathom-analytics.md +150 -0
- package/docs/integrations/google-maps.md +263 -0
- package/docs/integrations/google-tag-manager.md +154 -0
- package/docs/integrations/google-tag.md +134 -0
- package/docs/integrations/heap.md +219 -0
- package/docs/integrations/hightouch.md +199 -0
- package/docs/integrations/hotjar.md +143 -0
- package/docs/integrations/intercom.md +144 -0
- package/docs/integrations/linkedin-insights.md +161 -0
- package/docs/integrations/logrocket.md +175 -0
- package/docs/integrations/matomo-analytics.md +171 -0
- package/docs/integrations/meta-pixel.md +412 -0
- package/docs/integrations/microsoft-clarity.md +173 -0
- package/docs/integrations/microsoft-uet.md +156 -0
- package/docs/integrations/mixpanel-analytics.md +130 -0
- package/docs/integrations/overview.md +149 -0
- package/docs/integrations/pirsch.md +142 -0
- package/docs/integrations/plausible-analytics.md +154 -0
- package/docs/integrations/posthog.md +258 -0
- package/docs/integrations/promptwatch.md +121 -0
- package/docs/integrations/reddit-pixel.md +241 -0
- package/docs/integrations/rudderstack.md +271 -0
- package/docs/integrations/rybbit-analytics.md +143 -0
- package/docs/integrations/segment.md +146 -0
- package/docs/integrations/snapchat-pixel.md +163 -0
- package/docs/integrations/tiktok-pixel.md +123 -0
- package/docs/integrations/umami-analytics.md +148 -0
- package/docs/integrations/vercel-analytics.md +141 -0
- package/docs/integrations/x-pixel.md +157 -0
- package/docs/integrations/youtube.md +193 -0
- package/docs/shared/react/guides/script-loader.md +309 -0
- package/package.json +223 -8
- package/readme.json +8 -4
- package/dist/meta-pixel.cjs +0 -129
- package/dist/meta-pixel.js +0 -89
- package/dist/posthog.cjs +0 -137
- package/dist/posthog.js +0 -100
- package/dist-types/linkedin-insights.d.ts +0 -79
- package/dist-types/meta-pixel.d.ts +0 -185
- package/dist-types/posthog.d.ts +0 -112
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import type { ConsentState, Script, ScriptCallbackInfo } from 'c15t';
|
|
2
|
+
import { type BuiltInScriptIntegrationKey } from '../registry';
|
|
3
|
+
/**
|
|
4
|
+
* Typed view of `globalThis` used by script helper tests.
|
|
5
|
+
*
|
|
6
|
+
* Additional string-keyed properties model browser and vendor globals created
|
|
7
|
+
* during setup and individual test cases.
|
|
8
|
+
*/
|
|
9
|
+
export type TestGlobal = typeof globalThis & Record<string, unknown>;
|
|
10
|
+
/**
|
|
11
|
+
* Snapshot of the script fields asserted by helper tests.
|
|
12
|
+
*/
|
|
13
|
+
export interface HelperScriptSnapshot {
|
|
14
|
+
/** Unique script identifier generated by the helper under test. */
|
|
15
|
+
id: string;
|
|
16
|
+
/** Consent category associated with the script integration. */
|
|
17
|
+
category: unknown;
|
|
18
|
+
/** Whether the script should load even before optional consent is granted. */
|
|
19
|
+
alwaysLoad?: boolean;
|
|
20
|
+
/** Whether the script stays loaded after consent for its category is revoked. */
|
|
21
|
+
persistAfterConsentRevoked?: boolean;
|
|
22
|
+
/** Remote script URL emitted by the helper, when applicable. */
|
|
23
|
+
src?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Expected integration metadata and script attributes for a helper assertion.
|
|
27
|
+
*/
|
|
28
|
+
export interface ExpectedScriptSnapshot {
|
|
29
|
+
/** Expected `alwaysLoad` flag from the generated helper script. */
|
|
30
|
+
alwaysLoad: boolean | undefined;
|
|
31
|
+
/** Expected consent-revocation persistence flag from the generated script. */
|
|
32
|
+
persistAfterConsentRevoked: boolean | undefined;
|
|
33
|
+
/** Expected remote script URL from the generated helper script. */
|
|
34
|
+
src: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Consent state with only required storage enabled.
|
|
38
|
+
*
|
|
39
|
+
* `necessary` keeps essential storage on, `functionality` covers site
|
|
40
|
+
* preferences, `measurement` controls analytics, `marketing` controls
|
|
41
|
+
* advertising-related storage, and `experience` controls personalization.
|
|
42
|
+
*/
|
|
43
|
+
export declare const deniedConsentState: ConsentState;
|
|
44
|
+
/**
|
|
45
|
+
* Consent state with required and measurement storage enabled.
|
|
46
|
+
*
|
|
47
|
+
* `necessary` keeps essential storage on, `functionality` covers site
|
|
48
|
+
* preferences, `measurement` controls analytics, `marketing` controls
|
|
49
|
+
* advertising-related storage, and `experience` controls personalization.
|
|
50
|
+
*/
|
|
51
|
+
export declare const grantedMeasurementConsentState: ConsentState;
|
|
52
|
+
/**
|
|
53
|
+
* Required callback fields for creating a script lifecycle payload in tests.
|
|
54
|
+
*/
|
|
55
|
+
export type CallbackInfoOverrides = Partial<ScriptCallbackInfo> & Pick<ScriptCallbackInfo, 'id'>;
|
|
56
|
+
/**
|
|
57
|
+
* Creates a fully typed callback payload for script lifecycle tests.
|
|
58
|
+
*
|
|
59
|
+
* Defaults model a denied-consent callback for the same DOM element ID as the
|
|
60
|
+
* script ID, while allowing individual tests to override the relevant fields.
|
|
61
|
+
*/
|
|
62
|
+
export declare function createCallbackInfo(overrides: CallbackInfoOverrides): ScriptCallbackInfo;
|
|
63
|
+
export type LifecycleCallbackOverrides = Partial<Omit<ScriptCallbackInfo, 'id'>>;
|
|
64
|
+
export declare function runOnBeforeLoad(script: Pick<Script, 'id' | 'onBeforeLoad'>, overrides?: LifecycleCallbackOverrides): void;
|
|
65
|
+
/**
|
|
66
|
+
* Returns a mutable test-friendly reference to the global object.
|
|
67
|
+
*
|
|
68
|
+
* @returns The current global object cast to `TestGlobal`.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* const globalRef = getTestGlobal();
|
|
73
|
+
* globalRef.dataLayer = [];
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export declare function getTestGlobal(): TestGlobal;
|
|
77
|
+
/**
|
|
78
|
+
* Registers browser-like setup and teardown hooks for script helper tests.
|
|
79
|
+
*
|
|
80
|
+
* Before each test, this installs mocked `window` and `document` globals.
|
|
81
|
+
* After each test, it unstubs globals and removes vendor-specific globals left
|
|
82
|
+
* behind by script execution.
|
|
83
|
+
*
|
|
84
|
+
* @returns Nothing.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* describe('googleTagManager', () => {
|
|
89
|
+
* setupScriptHelperTest();
|
|
90
|
+
* });
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare function setupScriptHelperTest(): void;
|
|
94
|
+
/**
|
|
95
|
+
* Asserts that a helper-generated script matches registry metadata and
|
|
96
|
+
* expected script fields.
|
|
97
|
+
*
|
|
98
|
+
* @param key - Built-in integration key used to find the registry entry.
|
|
99
|
+
* @param script - Snapshot of the helper-generated script under test.
|
|
100
|
+
* @param expected - Expected script metadata and output for the assertion.
|
|
101
|
+
* @returns Nothing.
|
|
102
|
+
*
|
|
103
|
+
* @remarks
|
|
104
|
+
* If `key` does not match any built-in integration, the assertion fails before
|
|
105
|
+
* the non-null access is used.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```ts
|
|
109
|
+
* expectScriptMatchesIntegration(
|
|
110
|
+
* 'googleTagManager',
|
|
111
|
+
* googleTagManager({ id: 'GTM-123' }),
|
|
112
|
+
* {
|
|
113
|
+
* alwaysLoad: true,
|
|
114
|
+
* persistAfterConsentRevoked: undefined,
|
|
115
|
+
* src: 'https://www.googletagmanager.com/gtm.js?id=GTM-123',
|
|
116
|
+
* }
|
|
117
|
+
* );
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
export declare function expectScriptMatchesIntegration(key: BuiltInScriptIntegrationKey, script: HelperScriptSnapshot, expected: ExpectedScriptSnapshot): void;
|
|
121
|
+
/**
|
|
122
|
+
* Converts an array-like value into a plain array.
|
|
123
|
+
*
|
|
124
|
+
* @param value - Array-like input such as `arguments`, a `NodeList`, or a
|
|
125
|
+
* vendor queue entry.
|
|
126
|
+
* @returns A new array containing the indexed values from `value`.
|
|
127
|
+
*
|
|
128
|
+
* @remarks
|
|
129
|
+
* Passing `null` or `undefined` throws because `slice` requires an object-like
|
|
130
|
+
* value.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```ts
|
|
134
|
+
* function collectArgs(...args: unknown[]) {
|
|
135
|
+
* return toArgumentsArray(args);
|
|
136
|
+
* }
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
export declare function toArgumentsArray(value: unknown): unknown[];
|
|
140
|
+
export declare function expectGoogleConsentDefault(entry: unknown): void;
|
|
141
|
+
export declare function expectStubCommandQueue(stub: unknown, queueKey: string, commands: unknown[][]): void;
|
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* High-level product area for a built-in script integration.
|
|
3
|
+
*
|
|
4
|
+
* Used for discovery surfaces such as docs navigation and CLI grouping. This is
|
|
5
|
+
* intentionally separate from a manifest consent category.
|
|
6
|
+
*/
|
|
7
|
+
export type IntegrationCategory = 'analytics' | 'ads-and-pixels' | 'functional' | 'tag-manager';
|
|
8
|
+
/**
|
|
9
|
+
* Consent bucket that a built-in integration maps to by default.
|
|
10
|
+
*
|
|
11
|
+
* These values mirror c15t's consent categories without importing core types, so
|
|
12
|
+
* the registry stays safe to consume from docs and CLI code.
|
|
13
|
+
*/
|
|
14
|
+
export type IntegrationConsentCategory = 'necessary' | 'functionality' | 'experience' | 'measurement' | 'marketing';
|
|
15
|
+
/**
|
|
16
|
+
* Display metadata for an integration category.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const label = BUILT_IN_INTEGRATION_CATEGORIES[0]?.label;
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export interface IntegrationCategoryEntry {
|
|
24
|
+
/** Stable category key used by registry entries. */
|
|
25
|
+
key: IntegrationCategory;
|
|
26
|
+
/** Human-readable label for display surfaces. */
|
|
27
|
+
label: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Identity and discovery metadata for a built-in script integration.
|
|
31
|
+
*
|
|
32
|
+
* All fields are required except `hint`, which is optional short help text for
|
|
33
|
+
* picker UIs. Do not add runtime behavior, disclosure metadata, or vendor
|
|
34
|
+
* implementation details here.
|
|
35
|
+
*/
|
|
36
|
+
export interface IntegrationRegistryEntry {
|
|
37
|
+
/** Stable key used by tests and generated metadata. */
|
|
38
|
+
key: string;
|
|
39
|
+
/** Script id emitted by the resolved helper. */
|
|
40
|
+
vendor: string;
|
|
41
|
+
/** Human-readable integration name. */
|
|
42
|
+
label: string;
|
|
43
|
+
/** Optional short description for CLI or docs picker UIs. */
|
|
44
|
+
hint?: string;
|
|
45
|
+
/** Docs route slug for this integration. */
|
|
46
|
+
docsSlug: string;
|
|
47
|
+
/** Package subpath, e.g. `meta-pixel` for `@c15t/scripts/meta-pixel`. */
|
|
48
|
+
packageSubpath: string;
|
|
49
|
+
/** Product area used for grouping and discovery. */
|
|
50
|
+
integrationCategory: IntegrationCategory;
|
|
51
|
+
/** Default consent bucket expected from the generated script. */
|
|
52
|
+
consentCategory: IntegrationConsentCategory;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Canonical display list for built-in integration categories.
|
|
56
|
+
*
|
|
57
|
+
* Consumers should use this list for category labels and ordering instead of
|
|
58
|
+
* re-declaring category names.
|
|
59
|
+
*/
|
|
60
|
+
export declare const BUILT_IN_INTEGRATION_CATEGORIES: readonly [{
|
|
61
|
+
readonly key: 'analytics';
|
|
62
|
+
readonly label: 'Analytics';
|
|
63
|
+
}, {
|
|
64
|
+
readonly key: 'ads-and-pixels';
|
|
65
|
+
readonly label: 'Ads & Pixels';
|
|
66
|
+
}, {
|
|
67
|
+
readonly key: 'functional';
|
|
68
|
+
readonly label: 'Functional';
|
|
69
|
+
}, {
|
|
70
|
+
readonly key: 'tag-manager';
|
|
71
|
+
readonly label: 'Tag Managers';
|
|
72
|
+
}];
|
|
73
|
+
/**
|
|
74
|
+
* Canonical identity catalog for built-in `@c15t/scripts` integrations.
|
|
75
|
+
*
|
|
76
|
+
* Adding a new built-in integration should add one row here so docs, tests, and
|
|
77
|
+
* the CLI can discover it from the same source.
|
|
78
|
+
*/
|
|
79
|
+
export declare const builtInScriptIntegrations: readonly [{
|
|
80
|
+
readonly key: 'googleTagManager';
|
|
81
|
+
readonly vendor: 'google-tag-manager';
|
|
82
|
+
readonly label: 'Google Tag Manager';
|
|
83
|
+
readonly hint: 'GTM container script';
|
|
84
|
+
readonly docsSlug: 'google-tag-manager';
|
|
85
|
+
readonly packageSubpath: 'google-tag-manager';
|
|
86
|
+
readonly integrationCategory: 'tag-manager';
|
|
87
|
+
readonly consentCategory: 'necessary';
|
|
88
|
+
}, {
|
|
89
|
+
readonly key: 'gtag';
|
|
90
|
+
readonly vendor: 'gtag';
|
|
91
|
+
readonly label: 'Google Tag (gtag.js)';
|
|
92
|
+
readonly hint: 'Google Analytics 4';
|
|
93
|
+
readonly docsSlug: 'google-tag';
|
|
94
|
+
readonly packageSubpath: 'google-tag';
|
|
95
|
+
readonly integrationCategory: 'analytics';
|
|
96
|
+
readonly consentCategory: 'measurement';
|
|
97
|
+
}, {
|
|
98
|
+
readonly key: 'ahrefsAnalytics';
|
|
99
|
+
readonly vendor: 'ahrefs-analytics';
|
|
100
|
+
readonly label: 'Ahrefs Analytics';
|
|
101
|
+
readonly hint: 'Cookieless web analytics from Ahrefs';
|
|
102
|
+
readonly docsSlug: 'ahrefs-analytics';
|
|
103
|
+
readonly packageSubpath: 'ahrefs-analytics';
|
|
104
|
+
readonly integrationCategory: 'analytics';
|
|
105
|
+
readonly consentCategory: 'measurement';
|
|
106
|
+
}, {
|
|
107
|
+
readonly key: 'adobeAnalytics';
|
|
108
|
+
readonly vendor: 'adobe-analytics';
|
|
109
|
+
readonly label: 'Adobe Analytics';
|
|
110
|
+
readonly hint: 'Adobe Experience Platform tags';
|
|
111
|
+
readonly docsSlug: 'adobe-analytics';
|
|
112
|
+
readonly packageSubpath: 'adobe-analytics';
|
|
113
|
+
readonly integrationCategory: 'analytics';
|
|
114
|
+
readonly consentCategory: 'measurement';
|
|
115
|
+
}, {
|
|
116
|
+
readonly key: 'amplitude';
|
|
117
|
+
readonly vendor: 'amplitude';
|
|
118
|
+
readonly label: 'Amplitude';
|
|
119
|
+
readonly hint: 'Product analytics';
|
|
120
|
+
readonly docsSlug: 'amplitude';
|
|
121
|
+
readonly packageSubpath: 'amplitude';
|
|
122
|
+
readonly integrationCategory: 'analytics';
|
|
123
|
+
readonly consentCategory: 'measurement';
|
|
124
|
+
}, {
|
|
125
|
+
readonly key: 'cloudflareWebAnalytics';
|
|
126
|
+
readonly vendor: 'cloudflare-web-analytics';
|
|
127
|
+
readonly label: 'Cloudflare Web Analytics';
|
|
128
|
+
readonly hint: 'Cookieless analytics from Cloudflare';
|
|
129
|
+
readonly docsSlug: 'cloudflare-web-analytics';
|
|
130
|
+
readonly packageSubpath: 'cloudflare-web-analytics';
|
|
131
|
+
readonly integrationCategory: 'analytics';
|
|
132
|
+
readonly consentCategory: 'measurement';
|
|
133
|
+
}, {
|
|
134
|
+
readonly key: 'clearbit';
|
|
135
|
+
readonly vendor: 'clearbit';
|
|
136
|
+
readonly label: 'Clearbit';
|
|
137
|
+
readonly hint: 'Visitor and company enrichment';
|
|
138
|
+
readonly docsSlug: 'clearbit';
|
|
139
|
+
readonly packageSubpath: 'clearbit';
|
|
140
|
+
readonly integrationCategory: 'analytics';
|
|
141
|
+
readonly consentCategory: 'marketing';
|
|
142
|
+
}, {
|
|
143
|
+
readonly key: 'microsoft-clarity';
|
|
144
|
+
readonly vendor: 'microsoft-clarity';
|
|
145
|
+
readonly label: 'Microsoft Clarity';
|
|
146
|
+
readonly hint: 'Session replay and heatmaps';
|
|
147
|
+
readonly docsSlug: 'microsoft-clarity';
|
|
148
|
+
readonly packageSubpath: 'microsoft-clarity';
|
|
149
|
+
readonly integrationCategory: 'analytics';
|
|
150
|
+
readonly consentCategory: 'measurement';
|
|
151
|
+
}, {
|
|
152
|
+
readonly key: 'databuddy';
|
|
153
|
+
readonly vendor: 'databuddy';
|
|
154
|
+
readonly label: 'Databuddy';
|
|
155
|
+
readonly hint: 'Data collection';
|
|
156
|
+
readonly docsSlug: 'databuddy';
|
|
157
|
+
readonly packageSubpath: 'databuddy';
|
|
158
|
+
readonly integrationCategory: 'analytics';
|
|
159
|
+
readonly consentCategory: 'measurement';
|
|
160
|
+
}, {
|
|
161
|
+
readonly key: 'fathomAnalytics';
|
|
162
|
+
readonly vendor: 'fathom-analytics';
|
|
163
|
+
readonly label: 'Fathom Analytics';
|
|
164
|
+
readonly hint: 'Privacy-friendly cookieless analytics';
|
|
165
|
+
readonly docsSlug: 'fathom-analytics';
|
|
166
|
+
readonly packageSubpath: 'fathom-analytics';
|
|
167
|
+
readonly integrationCategory: 'analytics';
|
|
168
|
+
readonly consentCategory: 'measurement';
|
|
169
|
+
}, {
|
|
170
|
+
readonly key: 'heap';
|
|
171
|
+
readonly vendor: 'heap';
|
|
172
|
+
readonly label: 'Heap';
|
|
173
|
+
readonly hint: 'Autocapture product analytics';
|
|
174
|
+
readonly docsSlug: 'heap';
|
|
175
|
+
readonly packageSubpath: 'heap';
|
|
176
|
+
readonly integrationCategory: 'analytics';
|
|
177
|
+
readonly consentCategory: 'measurement';
|
|
178
|
+
}, {
|
|
179
|
+
readonly key: 'mixpanelAnalytics';
|
|
180
|
+
readonly vendor: 'mixpanel-analytics';
|
|
181
|
+
readonly label: 'Mixpanel Analytics';
|
|
182
|
+
readonly hint: 'Product analytics and funnels';
|
|
183
|
+
readonly docsSlug: 'mixpanel-analytics';
|
|
184
|
+
readonly packageSubpath: 'mixpanel-analytics';
|
|
185
|
+
readonly integrationCategory: 'analytics';
|
|
186
|
+
readonly consentCategory: 'measurement';
|
|
187
|
+
}, {
|
|
188
|
+
readonly key: 'hotjar';
|
|
189
|
+
readonly vendor: 'hotjar';
|
|
190
|
+
readonly label: 'Hotjar';
|
|
191
|
+
readonly hint: 'Heatmaps and session recordings';
|
|
192
|
+
readonly docsSlug: 'hotjar';
|
|
193
|
+
readonly packageSubpath: 'hotjar';
|
|
194
|
+
readonly integrationCategory: 'analytics';
|
|
195
|
+
readonly consentCategory: 'measurement';
|
|
196
|
+
}, {
|
|
197
|
+
readonly key: 'hightouch';
|
|
198
|
+
readonly vendor: 'hightouch';
|
|
199
|
+
readonly label: 'Hightouch';
|
|
200
|
+
readonly hint: 'Customer data platform events';
|
|
201
|
+
readonly docsSlug: 'hightouch';
|
|
202
|
+
readonly packageSubpath: 'hightouch';
|
|
203
|
+
readonly integrationCategory: 'analytics';
|
|
204
|
+
readonly consentCategory: 'measurement';
|
|
205
|
+
}, {
|
|
206
|
+
readonly key: 'rudderstack';
|
|
207
|
+
readonly vendor: 'rudderstack';
|
|
208
|
+
readonly label: 'RudderStack';
|
|
209
|
+
readonly hint: 'Customer data platform events';
|
|
210
|
+
readonly docsSlug: 'rudderstack';
|
|
211
|
+
readonly packageSubpath: 'rudderstack';
|
|
212
|
+
readonly integrationCategory: 'analytics';
|
|
213
|
+
readonly consentCategory: 'measurement';
|
|
214
|
+
}, {
|
|
215
|
+
readonly key: 'logRocket';
|
|
216
|
+
readonly vendor: 'logrocket';
|
|
217
|
+
readonly label: 'LogRocket';
|
|
218
|
+
readonly hint: 'Session replay and monitoring';
|
|
219
|
+
readonly docsSlug: 'logrocket';
|
|
220
|
+
readonly packageSubpath: 'logrocket';
|
|
221
|
+
readonly integrationCategory: 'analytics';
|
|
222
|
+
readonly consentCategory: 'measurement';
|
|
223
|
+
}, {
|
|
224
|
+
readonly key: 'matomoAnalytics';
|
|
225
|
+
readonly vendor: 'matomo-analytics';
|
|
226
|
+
readonly label: 'Matomo Analytics';
|
|
227
|
+
readonly hint: 'Self-hosted privacy analytics';
|
|
228
|
+
readonly docsSlug: 'matomo-analytics';
|
|
229
|
+
readonly packageSubpath: 'matomo-analytics';
|
|
230
|
+
readonly integrationCategory: 'analytics';
|
|
231
|
+
readonly consentCategory: 'measurement';
|
|
232
|
+
}, {
|
|
233
|
+
readonly key: 'posthog';
|
|
234
|
+
readonly vendor: 'posthog';
|
|
235
|
+
readonly label: 'PostHog';
|
|
236
|
+
readonly hint: 'Product analytics';
|
|
237
|
+
readonly docsSlug: 'posthog';
|
|
238
|
+
readonly packageSubpath: 'posthog';
|
|
239
|
+
readonly integrationCategory: 'analytics';
|
|
240
|
+
readonly consentCategory: 'measurement';
|
|
241
|
+
}, {
|
|
242
|
+
readonly key: 'promptwatch';
|
|
243
|
+
readonly vendor: 'promptwatch';
|
|
244
|
+
readonly label: 'Promptwatch';
|
|
245
|
+
readonly hint: 'AI traffic analytics';
|
|
246
|
+
readonly docsSlug: 'promptwatch';
|
|
247
|
+
readonly packageSubpath: 'promptwatch';
|
|
248
|
+
readonly integrationCategory: 'analytics';
|
|
249
|
+
readonly consentCategory: 'measurement';
|
|
250
|
+
}, {
|
|
251
|
+
readonly key: 'pirsch';
|
|
252
|
+
readonly vendor: 'pirsch';
|
|
253
|
+
readonly label: 'Pirsch';
|
|
254
|
+
readonly hint: 'Privacy-friendly cookieless analytics';
|
|
255
|
+
readonly docsSlug: 'pirsch';
|
|
256
|
+
readonly packageSubpath: 'pirsch';
|
|
257
|
+
readonly integrationCategory: 'analytics';
|
|
258
|
+
readonly consentCategory: 'measurement';
|
|
259
|
+
}, {
|
|
260
|
+
readonly key: 'segment';
|
|
261
|
+
readonly vendor: 'segment';
|
|
262
|
+
readonly label: 'Segment';
|
|
263
|
+
readonly hint: 'Customer data platform';
|
|
264
|
+
readonly docsSlug: 'segment';
|
|
265
|
+
readonly packageSubpath: 'segment';
|
|
266
|
+
readonly integrationCategory: 'analytics';
|
|
267
|
+
readonly consentCategory: 'measurement';
|
|
268
|
+
}, {
|
|
269
|
+
readonly key: 'rybbitAnalytics';
|
|
270
|
+
readonly vendor: 'rybbit-analytics';
|
|
271
|
+
readonly label: 'Rybbit Analytics';
|
|
272
|
+
readonly hint: 'Privacy-friendly web analytics';
|
|
273
|
+
readonly docsSlug: 'rybbit-analytics';
|
|
274
|
+
readonly packageSubpath: 'rybbit-analytics';
|
|
275
|
+
readonly integrationCategory: 'analytics';
|
|
276
|
+
readonly consentCategory: 'measurement';
|
|
277
|
+
}, {
|
|
278
|
+
readonly key: 'plausibleAnalytics';
|
|
279
|
+
readonly vendor: 'plausible-analytics';
|
|
280
|
+
readonly label: 'Plausible Analytics';
|
|
281
|
+
readonly hint: 'Privacy-friendly cookieless analytics';
|
|
282
|
+
readonly docsSlug: 'plausible-analytics';
|
|
283
|
+
readonly packageSubpath: 'plausible-analytics';
|
|
284
|
+
readonly integrationCategory: 'analytics';
|
|
285
|
+
readonly consentCategory: 'measurement';
|
|
286
|
+
}, {
|
|
287
|
+
readonly key: 'umamiAnalytics';
|
|
288
|
+
readonly vendor: 'umami-analytics';
|
|
289
|
+
readonly label: 'Umami Analytics';
|
|
290
|
+
readonly hint: 'Open-source cookieless analytics';
|
|
291
|
+
readonly docsSlug: 'umami-analytics';
|
|
292
|
+
readonly packageSubpath: 'umami-analytics';
|
|
293
|
+
readonly integrationCategory: 'analytics';
|
|
294
|
+
readonly consentCategory: 'measurement';
|
|
295
|
+
}, {
|
|
296
|
+
readonly key: 'vercelAnalytics';
|
|
297
|
+
readonly vendor: 'vercel-analytics';
|
|
298
|
+
readonly label: 'Vercel Analytics';
|
|
299
|
+
readonly hint: 'Vercel web analytics';
|
|
300
|
+
readonly docsSlug: 'vercel-analytics';
|
|
301
|
+
readonly packageSubpath: 'vercel-analytics';
|
|
302
|
+
readonly integrationCategory: 'analytics';
|
|
303
|
+
readonly consentCategory: 'measurement';
|
|
304
|
+
}, {
|
|
305
|
+
readonly key: 'crisp';
|
|
306
|
+
readonly vendor: 'crisp';
|
|
307
|
+
readonly label: 'Crisp';
|
|
308
|
+
readonly hint: 'Live chat widget';
|
|
309
|
+
readonly docsSlug: 'crisp';
|
|
310
|
+
readonly packageSubpath: 'crisp';
|
|
311
|
+
readonly integrationCategory: 'functional';
|
|
312
|
+
readonly consentCategory: 'functionality';
|
|
313
|
+
}, {
|
|
314
|
+
readonly key: 'intercom';
|
|
315
|
+
readonly vendor: 'intercom';
|
|
316
|
+
readonly label: 'Intercom';
|
|
317
|
+
readonly hint: 'Messenger and live chat widget';
|
|
318
|
+
readonly docsSlug: 'intercom';
|
|
319
|
+
readonly packageSubpath: 'intercom';
|
|
320
|
+
readonly integrationCategory: 'functional';
|
|
321
|
+
readonly consentCategory: 'functionality';
|
|
322
|
+
}, {
|
|
323
|
+
readonly key: 'metaPixel';
|
|
324
|
+
readonly vendor: 'meta-pixel';
|
|
325
|
+
readonly label: 'Meta Pixel';
|
|
326
|
+
readonly hint: 'Facebook/Instagram tracking';
|
|
327
|
+
readonly docsSlug: 'meta-pixel';
|
|
328
|
+
readonly packageSubpath: 'meta-pixel';
|
|
329
|
+
readonly integrationCategory: 'ads-and-pixels';
|
|
330
|
+
readonly consentCategory: 'marketing';
|
|
331
|
+
}, {
|
|
332
|
+
readonly key: 'redditPixel';
|
|
333
|
+
readonly vendor: 'reddit-pixel';
|
|
334
|
+
readonly label: 'Reddit Pixel';
|
|
335
|
+
readonly hint: 'Reddit ads tracking';
|
|
336
|
+
readonly docsSlug: 'reddit-pixel';
|
|
337
|
+
readonly packageSubpath: 'reddit-pixel';
|
|
338
|
+
readonly integrationCategory: 'ads-and-pixels';
|
|
339
|
+
readonly consentCategory: 'marketing';
|
|
340
|
+
}, {
|
|
341
|
+
readonly key: 'tiktokPixel';
|
|
342
|
+
readonly vendor: 'tiktok-pixel';
|
|
343
|
+
readonly label: 'TikTok Pixel';
|
|
344
|
+
readonly hint: 'TikTok ads tracking';
|
|
345
|
+
readonly docsSlug: 'tiktok-pixel';
|
|
346
|
+
readonly packageSubpath: 'tiktok-pixel';
|
|
347
|
+
readonly integrationCategory: 'ads-and-pixels';
|
|
348
|
+
readonly consentCategory: 'marketing';
|
|
349
|
+
}, {
|
|
350
|
+
readonly key: 'linkedinInsights';
|
|
351
|
+
readonly vendor: 'linkedin-insights';
|
|
352
|
+
readonly label: 'LinkedIn Insight Tag';
|
|
353
|
+
readonly hint: 'LinkedIn conversion tracking';
|
|
354
|
+
readonly docsSlug: 'linkedin-insights';
|
|
355
|
+
readonly packageSubpath: 'linkedin-insights';
|
|
356
|
+
readonly integrationCategory: 'ads-and-pixels';
|
|
357
|
+
readonly consentCategory: 'marketing';
|
|
358
|
+
}, {
|
|
359
|
+
readonly key: 'microsoftUet';
|
|
360
|
+
readonly vendor: 'microsoft-uet';
|
|
361
|
+
readonly label: 'Microsoft UET';
|
|
362
|
+
readonly hint: 'Bing Ads tracking';
|
|
363
|
+
readonly docsSlug: 'microsoft-uet';
|
|
364
|
+
readonly packageSubpath: 'microsoft-uet';
|
|
365
|
+
readonly integrationCategory: 'ads-and-pixels';
|
|
366
|
+
readonly consentCategory: 'marketing';
|
|
367
|
+
}, {
|
|
368
|
+
readonly key: 'snapchatPixel';
|
|
369
|
+
readonly vendor: 'snapchat-pixel';
|
|
370
|
+
readonly label: 'Snapchat Pixel';
|
|
371
|
+
readonly hint: 'Snapchat ads tracking';
|
|
372
|
+
readonly docsSlug: 'snapchat-pixel';
|
|
373
|
+
readonly packageSubpath: 'snapchat-pixel';
|
|
374
|
+
readonly integrationCategory: 'ads-and-pixels';
|
|
375
|
+
readonly consentCategory: 'marketing';
|
|
376
|
+
}, {
|
|
377
|
+
readonly key: 'xPixel';
|
|
378
|
+
readonly vendor: 'x-pixel';
|
|
379
|
+
readonly label: 'X (Twitter) Pixel';
|
|
380
|
+
readonly hint: 'X/Twitter conversion tracking';
|
|
381
|
+
readonly docsSlug: 'x-pixel';
|
|
382
|
+
readonly packageSubpath: 'x-pixel';
|
|
383
|
+
readonly integrationCategory: 'ads-and-pixels';
|
|
384
|
+
readonly consentCategory: 'marketing';
|
|
385
|
+
}];
|
|
386
|
+
/**
|
|
387
|
+
* Concrete registry entry type inferred from `builtInScriptIntegrations`.
|
|
388
|
+
*/
|
|
389
|
+
export type BuiltInScriptIntegration = (typeof builtInScriptIntegrations)[number];
|
|
390
|
+
/**
|
|
391
|
+
* Union of stable keys for built-in integrations.
|
|
392
|
+
*/
|
|
393
|
+
export type BuiltInScriptIntegrationKey = BuiltInScriptIntegration['key'];
|
|
394
|
+
/**
|
|
395
|
+
* Union of public package subpaths for built-in integrations.
|
|
396
|
+
*/
|
|
397
|
+
export type BuiltInScriptIntegrationSubpath = BuiltInScriptIntegration['packageSubpath'];
|
|
398
|
+
/**
|
|
399
|
+
* Looks up a built-in integration by its registry key.
|
|
400
|
+
*
|
|
401
|
+
* @param key - Stable integration key.
|
|
402
|
+
* @returns The matching built-in integration entry.
|
|
403
|
+
* @throws `Error("Unknown built-in script integration: <key>")` when the key is
|
|
404
|
+
* not present. Catch this when accepting untrusted or user-provided keys.
|
|
405
|
+
*
|
|
406
|
+
* @example
|
|
407
|
+
* ```ts
|
|
408
|
+
* const integration = getBuiltInScriptIntegration('metaPixel');
|
|
409
|
+
* console.log(integration.packageSubpath); // "meta-pixel"
|
|
410
|
+
* ```
|
|
411
|
+
*/
|
|
412
|
+
export declare function getBuiltInScriptIntegration(key: BuiltInScriptIntegrationKey): BuiltInScriptIntegration;
|
|
413
|
+
/**
|
|
414
|
+
* Finds a built-in integration by its public package subpath.
|
|
415
|
+
*
|
|
416
|
+
* @param subpath - Kebab-case subpath such as `google-tag`.
|
|
417
|
+
* @returns The matching integration, or `undefined` when no entry matches.
|
|
418
|
+
*
|
|
419
|
+
* @example
|
|
420
|
+
* ```ts
|
|
421
|
+
* const integration = getBuiltInScriptIntegrationBySubpath('meta-pixel');
|
|
422
|
+
* console.log(integration?.label); // "Meta Pixel"
|
|
423
|
+
* ```
|
|
424
|
+
*/
|
|
425
|
+
export declare function getBuiltInScriptIntegrationBySubpath(subpath: string): BuiltInScriptIntegration | undefined;
|
|
426
|
+
/**
|
|
427
|
+
* Finds a built-in integration by the emitted script vendor id.
|
|
428
|
+
*
|
|
429
|
+
* Use this to connect a resolved manifest/script id back to registry metadata.
|
|
430
|
+
*
|
|
431
|
+
* @param vendor - Vendor id emitted as `Script.id`.
|
|
432
|
+
* @returns The matching integration, or `undefined` when no entry matches.
|
|
433
|
+
*
|
|
434
|
+
* @example
|
|
435
|
+
* ```ts
|
|
436
|
+
* const integration = getBuiltInScriptIntegrationByVendor('google-tag-manager');
|
|
437
|
+
* console.log(integration?.label); // "Google Tag Manager"
|
|
438
|
+
* ```
|
|
439
|
+
*/
|
|
440
|
+
export declare function getBuiltInScriptIntegrationByVendor(vendor: string): BuiltInScriptIntegration | undefined;
|
package/dist-types/types.d.ts
CHANGED
|
@@ -5,6 +5,19 @@ export declare const vendorManifestContract: {
|
|
|
5
5
|
readonly kind: "c15t.vendor-manifest";
|
|
6
6
|
readonly schemaVersion: 1;
|
|
7
7
|
};
|
|
8
|
+
export declare const RUNTIME_VALUE_KIND = "c15t.runtime-value";
|
|
9
|
+
export interface RuntimeValue {
|
|
10
|
+
kind: typeof RUNTIME_VALUE_KIND;
|
|
11
|
+
value: 'date' | 'timestamp';
|
|
12
|
+
}
|
|
13
|
+
export declare const runtimeDateValue: {
|
|
14
|
+
readonly kind: "c15t.runtime-value";
|
|
15
|
+
readonly value: 'date';
|
|
16
|
+
};
|
|
17
|
+
export declare const runtimeTimestampValue: {
|
|
18
|
+
readonly kind: "c15t.runtime-value";
|
|
19
|
+
readonly value: 'timestamp';
|
|
20
|
+
};
|
|
8
21
|
export interface ManifestContract {
|
|
9
22
|
kind: typeof VENDOR_MANIFEST_KIND;
|
|
10
23
|
schemaVersion: typeof VENDOR_MANIFEST_SCHEMA_VERSION;
|
|
@@ -121,6 +134,40 @@ export interface DefineQueueMethodsStep {
|
|
|
121
134
|
global?: never;
|
|
122
135
|
property: string;
|
|
123
136
|
};
|
|
137
|
+
/**
|
|
138
|
+
* Format used for each queued method call.
|
|
139
|
+
*
|
|
140
|
+
* - `tuple` pushes `[methodName, ...args]`, matching classic array queues.
|
|
141
|
+
* - `methodCall` pushes `{ name, args, resolve }` and returns a `Promise`,
|
|
142
|
+
* matching SDK loaders that replay named calls and resolve the original
|
|
143
|
+
* pre-load promise after the real method runs.
|
|
144
|
+
* - `wrappedMethodCall` queues like `methodCall` but returns
|
|
145
|
+
* `{ promise }`, matching Amplitude's snippet contract where queued
|
|
146
|
+
* proxy calls expose the pending promise on a `promise` property.
|
|
147
|
+
* - `voidMethodCall` queues like `methodCall` but returns nothing,
|
|
148
|
+
* matching snippet methods the vendor treats as synchronous.
|
|
149
|
+
* - `callback` pushes `{ name, fn }`, where `fn` replays the captured call
|
|
150
|
+
* against the current global target, matching loaders that own a
|
|
151
|
+
* ready-callback queue.
|
|
152
|
+
*
|
|
153
|
+
* @default 'tuple'
|
|
154
|
+
*/
|
|
155
|
+
queueFormat?: 'tuple' | 'methodCall' | 'wrappedMethodCall' | 'voidMethodCall' | 'callback';
|
|
156
|
+
}
|
|
157
|
+
export interface DefineQueueClassStep {
|
|
158
|
+
type: 'defineQueueClass';
|
|
159
|
+
/** Global object that receives the queued helper class. */
|
|
160
|
+
target: string;
|
|
161
|
+
/** Constructor property name to define on the target object. */
|
|
162
|
+
name: string;
|
|
163
|
+
/**
|
|
164
|
+
* Instance property that stores queued helper method calls.
|
|
165
|
+
*
|
|
166
|
+
* @default '_q'
|
|
167
|
+
*/
|
|
168
|
+
queueProperty?: string;
|
|
169
|
+
/** Helper instance method names to attach to the constructor prototype. */
|
|
170
|
+
methods: string[];
|
|
124
171
|
}
|
|
125
172
|
export type GlobalMethodBehavior = {
|
|
126
173
|
name: string;
|
|
@@ -150,13 +197,17 @@ export interface ConstructGlobalStep {
|
|
|
150
197
|
*/
|
|
151
198
|
copyAssignedValueToArgProperty?: string;
|
|
152
199
|
}
|
|
153
|
-
export type ManifestStep = LoadScriptStep | SetGlobalStep | DefineQueueFunctionStep | DefineStubFunctionStep | CallGlobalStep | PushToQueueStep | SetGlobalPathStep | DefineQueueMethodsStep | DefineGlobalMethodsStep | ConstructGlobalStep;
|
|
200
|
+
export type ManifestStep = LoadScriptStep | SetGlobalStep | DefineQueueFunctionStep | DefineStubFunctionStep | CallGlobalStep | PushToQueueStep | SetGlobalPathStep | DefineQueueMethodsStep | DefineQueueClassStep | DefineGlobalMethodsStep | ConstructGlobalStep;
|
|
154
201
|
/**
|
|
155
202
|
* Consent signal type determines how consent state is communicated to the vendor.
|
|
156
203
|
*
|
|
157
204
|
* - `'gtag'` — Google Consent Mode pattern: calls `gtag('consent', 'default'|'update', state)`
|
|
205
|
+
* - `'rudderstack'` — RudderStack consent-management pattern: calls
|
|
206
|
+
* `rudderanalytics.consent({ consentManagement: { enabled, provider: 'custom',
|
|
207
|
+
* allowedConsentIds, deniedConsentIds } })` with the mapping's consent IDs
|
|
208
|
+
* partitioned by the current c15t consent state
|
|
158
209
|
*/
|
|
159
|
-
export type ConsentSignalType = 'gtag';
|
|
210
|
+
export type ConsentSignalType = 'gtag' | 'rudderstack';
|
|
160
211
|
/**
|
|
161
212
|
* A declarative definition of a vendor integration.
|
|
162
213
|
*
|