@walkeros/web-destination-segment 4.7.2 → 4.8.0-next-1791496487198
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/CHANGELOG.md +15 -0
- package/README.md +6 -2
- package/dist/dev.d.mts +20 -15
- package/dist/dev.d.ts +20 -15
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/examples/index.d.mts +20 -15
- package/dist/examples/index.d.ts +20 -15
- package/dist/examples/index.js +15 -6
- package/dist/examples/index.mjs +15 -6
- package/dist/index.browser.js +1 -1
- package/dist/index.d.mts +10 -11
- package/dist/index.d.ts +10 -11
- package/dist/index.es5.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/walkerOS.json +78 -24
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -9,12 +9,11 @@ import { InitOptions, AnalyticsBrowserSettings } from '@segment/analytics-next';
|
|
|
9
9
|
* walkerOS's own `group` mapping) so every passthrough option (cookie,
|
|
10
10
|
* storage, integrations, plan, etc.) keeps IntelliSense intact. walkerOS
|
|
11
11
|
* adds:
|
|
12
|
-
* - `apiKey` (required)
|
|
13
|
-
* - `identify
|
|
14
|
-
* - `group
|
|
15
|
-
* - `
|
|
16
|
-
* - `
|
|
17
|
-
* - `_state` — runtime state (not user-facing, mutated by init/push)
|
|
12
|
+
* - `apiKey` (required): maps to `writeKey` in `AnalyticsBrowser.load()`
|
|
13
|
+
* - `identify`: destination-level identity mapping (Segment `identify()`)
|
|
14
|
+
* - `group`: destination-level group mapping (Segment `group()`)
|
|
15
|
+
* - `consent`: walkerOS consent key → Segment category name mapping
|
|
16
|
+
* - `_state`: runtime state (not user-facing, mutated by init/push)
|
|
18
17
|
*/
|
|
19
18
|
interface Settings extends Omit<InitOptions, 'group'> {
|
|
20
19
|
/** Segment write key. Maps to `writeKey` in the load() settings arg. */
|
|
@@ -26,10 +25,10 @@ interface Settings extends Omit<InitOptions, 'group'> {
|
|
|
26
25
|
/**
|
|
27
26
|
* Mapping from walkerOS consent keys → Segment `categoryPreferences` keys.
|
|
28
27
|
* Example: { marketing: "Advertising", analytics: "Analytics" }
|
|
29
|
-
* If omitted,
|
|
28
|
+
* Only mapped keys are forwarded. If omitted, no consent context is sent.
|
|
30
29
|
*/
|
|
31
30
|
consent?: Record<string, string>;
|
|
32
|
-
/** Runtime state
|
|
31
|
+
/** Runtime state: populated by init() and mutated by push(). Not user-facing. */
|
|
33
32
|
_state?: RuntimeState;
|
|
34
33
|
}
|
|
35
34
|
interface RuntimeState {
|
|
@@ -62,7 +61,7 @@ interface Mapping {
|
|
|
62
61
|
reset?: Mapping$1.Value | boolean;
|
|
63
62
|
}
|
|
64
63
|
/**
|
|
65
|
-
* Segment SDK surface
|
|
64
|
+
* Segment SDK surface: the subset of @segment/analytics-next the
|
|
66
65
|
* destination actually uses. Mirrors the AnalyticsBrowser instance shape
|
|
67
66
|
* so tests can mock each method individually via env.analytics.
|
|
68
67
|
*/
|
|
@@ -76,7 +75,7 @@ interface SegmentAnalytics {
|
|
|
76
75
|
setAnonymousId: (id: string) => Promise<unknown> | void;
|
|
77
76
|
}
|
|
78
77
|
/**
|
|
79
|
-
* Segment event options
|
|
78
|
+
* Segment event options: the fourth argument to track/identify/group/page
|
|
80
79
|
* that carries context and integration overrides. The destination uses
|
|
81
80
|
* this to stamp consent context on every event.
|
|
82
81
|
*/
|
|
@@ -102,7 +101,7 @@ interface SegmentSDK {
|
|
|
102
101
|
load: (settings: AnalyticsBrowserSettings, options?: InitOptions) => SegmentAnalytics;
|
|
103
102
|
}
|
|
104
103
|
/**
|
|
105
|
-
* Env
|
|
104
|
+
* Env: optional SDK override. Production leaves this undefined and the
|
|
106
105
|
* destination falls back to the real @segment/analytics-next module.
|
|
107
106
|
* Tests provide a mock via env.analytics = { ... }.
|
|
108
107
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -9,12 +9,11 @@ import { InitOptions, AnalyticsBrowserSettings } from '@segment/analytics-next';
|
|
|
9
9
|
* walkerOS's own `group` mapping) so every passthrough option (cookie,
|
|
10
10
|
* storage, integrations, plan, etc.) keeps IntelliSense intact. walkerOS
|
|
11
11
|
* adds:
|
|
12
|
-
* - `apiKey` (required)
|
|
13
|
-
* - `identify
|
|
14
|
-
* - `group
|
|
15
|
-
* - `
|
|
16
|
-
* - `
|
|
17
|
-
* - `_state` — runtime state (not user-facing, mutated by init/push)
|
|
12
|
+
* - `apiKey` (required): maps to `writeKey` in `AnalyticsBrowser.load()`
|
|
13
|
+
* - `identify`: destination-level identity mapping (Segment `identify()`)
|
|
14
|
+
* - `group`: destination-level group mapping (Segment `group()`)
|
|
15
|
+
* - `consent`: walkerOS consent key → Segment category name mapping
|
|
16
|
+
* - `_state`: runtime state (not user-facing, mutated by init/push)
|
|
18
17
|
*/
|
|
19
18
|
interface Settings extends Omit<InitOptions, 'group'> {
|
|
20
19
|
/** Segment write key. Maps to `writeKey` in the load() settings arg. */
|
|
@@ -26,10 +25,10 @@ interface Settings extends Omit<InitOptions, 'group'> {
|
|
|
26
25
|
/**
|
|
27
26
|
* Mapping from walkerOS consent keys → Segment `categoryPreferences` keys.
|
|
28
27
|
* Example: { marketing: "Advertising", analytics: "Analytics" }
|
|
29
|
-
* If omitted,
|
|
28
|
+
* Only mapped keys are forwarded. If omitted, no consent context is sent.
|
|
30
29
|
*/
|
|
31
30
|
consent?: Record<string, string>;
|
|
32
|
-
/** Runtime state
|
|
31
|
+
/** Runtime state: populated by init() and mutated by push(). Not user-facing. */
|
|
33
32
|
_state?: RuntimeState;
|
|
34
33
|
}
|
|
35
34
|
interface RuntimeState {
|
|
@@ -62,7 +61,7 @@ interface Mapping {
|
|
|
62
61
|
reset?: Mapping$1.Value | boolean;
|
|
63
62
|
}
|
|
64
63
|
/**
|
|
65
|
-
* Segment SDK surface
|
|
64
|
+
* Segment SDK surface: the subset of @segment/analytics-next the
|
|
66
65
|
* destination actually uses. Mirrors the AnalyticsBrowser instance shape
|
|
67
66
|
* so tests can mock each method individually via env.analytics.
|
|
68
67
|
*/
|
|
@@ -76,7 +75,7 @@ interface SegmentAnalytics {
|
|
|
76
75
|
setAnonymousId: (id: string) => Promise<unknown> | void;
|
|
77
76
|
}
|
|
78
77
|
/**
|
|
79
|
-
* Segment event options
|
|
78
|
+
* Segment event options: the fourth argument to track/identify/group/page
|
|
80
79
|
* that carries context and integration overrides. The destination uses
|
|
81
80
|
* this to stamp consent context on every event.
|
|
82
81
|
*/
|
|
@@ -102,7 +101,7 @@ interface SegmentSDK {
|
|
|
102
101
|
load: (settings: AnalyticsBrowserSettings, options?: InitOptions) => SegmentAnalytics;
|
|
103
102
|
}
|
|
104
103
|
/**
|
|
105
|
-
* Env
|
|
104
|
+
* Env: optional SDK override. Production leaves this undefined and the
|
|
106
105
|
* destination falls back to the real @segment/analytics-next module.
|
|
107
106
|
* Tests provide a mock via env.analytics = { ... }.
|
|
108
107
|
*/
|