@walkeros/web-destination-amplitude 4.8.1 → 4.8.2
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 +40 -0
- package/README.md +7 -0
- package/dist/dev.d.mts +56 -46
- package/dist/dev.d.ts +56 -46
- 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 +56 -46
- package/dist/examples/index.d.ts +56 -46
- package/dist/examples/index.js +31 -13
- package/dist/examples/index.mjs +32 -14
- package/dist/index.browser.js +1 -1
- package/dist/index.d.mts +46 -46
- package/dist/index.d.ts +46 -46
- package/dist/index.es5.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/walkerOS.json +133 -37
- package/package.json +7 -4
package/dist/index.d.mts
CHANGED
|
@@ -7,6 +7,7 @@ import { InitOptions } from '@amplitude/engagement-browser';
|
|
|
7
7
|
|
|
8
8
|
type BrowserOptions = Omit<Types$1.BrowserOptions, 'identify'>;
|
|
9
9
|
type AmplitudeBrowserOptions = Types$1.BrowserOptions;
|
|
10
|
+
type AmplitudePlugin = Types$1.Plugin;
|
|
10
11
|
/**
|
|
11
12
|
* Destination-level settings.
|
|
12
13
|
*
|
|
@@ -51,55 +52,53 @@ interface Mapping {
|
|
|
51
52
|
reset?: Mapping$1.Value | boolean;
|
|
52
53
|
}
|
|
53
54
|
/**
|
|
54
|
-
* Amplitude SDK surface
|
|
55
|
-
* destination actually uses. Mirrors the real
|
|
56
|
-
*
|
|
55
|
+
* Amplitude SDK surface: the subset of @amplitude/unified the
|
|
56
|
+
* destination actually uses. Mirrors the real client's methods so tests can
|
|
57
|
+
* mock each one via env.amplitude. Generic over the Identify and Revenue
|
|
58
|
+
* instances, so the real SDK gets back the instances it created.
|
|
57
59
|
*/
|
|
58
|
-
interface AmplitudeSDK {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
};
|
|
76
|
-
Identify: new () => IdentifyInstance;
|
|
77
|
-
Revenue: new () => RevenueInstance;
|
|
60
|
+
interface AmplitudeSDK<I extends IdentifyInstance = IdentifyInstance, R extends RevenueInstance = RevenueInstance> {
|
|
61
|
+
/** Analytics. */
|
|
62
|
+
init: (apiKey: string, options?: AmplitudeBrowserOptions) => unknown;
|
|
63
|
+
/** One plugin: Session Replay, Experiment or Guides & Surveys. */
|
|
64
|
+
add: (plugin: AmplitudePlugin) => unknown;
|
|
65
|
+
track: (eventType: string, eventProperties?: Record<string, unknown>) => unknown;
|
|
66
|
+
identify: (identify: I) => unknown;
|
|
67
|
+
revenue: (revenue: R) => unknown;
|
|
68
|
+
reset: () => unknown;
|
|
69
|
+
setOptOut: (optOut: boolean) => unknown;
|
|
70
|
+
setUserId: (userId: string | undefined) => unknown;
|
|
71
|
+
setDeviceId: (deviceId: string) => unknown;
|
|
72
|
+
setSessionId: (sessionId: number) => unknown;
|
|
73
|
+
setGroup: (groupType: string, groupName: string | string[]) => unknown;
|
|
74
|
+
groupIdentify: (groupType: string, groupName: string, identify: I) => unknown;
|
|
75
|
+
Identify: new () => I;
|
|
76
|
+
Revenue: new () => R;
|
|
78
77
|
}
|
|
79
|
-
/** Chainable Identify
|
|
78
|
+
/** Chainable Identify, as the @amplitude/unified Identify class. */
|
|
80
79
|
interface IdentifyInstance {
|
|
81
|
-
set
|
|
82
|
-
setOnce
|
|
83
|
-
add
|
|
84
|
-
append
|
|
85
|
-
prepend
|
|
86
|
-
preInsert
|
|
87
|
-
postInsert
|
|
88
|
-
remove
|
|
89
|
-
unset
|
|
90
|
-
clearAll
|
|
80
|
+
set(property: string, value: unknown): IdentifyInstance;
|
|
81
|
+
setOnce(property: string, value: unknown): IdentifyInstance;
|
|
82
|
+
add(property: string, value: number): IdentifyInstance;
|
|
83
|
+
append(property: string, value: unknown): IdentifyInstance;
|
|
84
|
+
prepend(property: string, value: unknown): IdentifyInstance;
|
|
85
|
+
preInsert(property: string, value: unknown): IdentifyInstance;
|
|
86
|
+
postInsert(property: string, value: unknown): IdentifyInstance;
|
|
87
|
+
remove(property: string, value: unknown): IdentifyInstance;
|
|
88
|
+
unset(property: string): IdentifyInstance;
|
|
89
|
+
clearAll(): IdentifyInstance;
|
|
91
90
|
}
|
|
92
|
-
/** Chainable Revenue
|
|
91
|
+
/** Chainable Revenue, as the @amplitude/unified Revenue class. */
|
|
93
92
|
interface RevenueInstance {
|
|
94
|
-
setProductId
|
|
95
|
-
setPrice
|
|
96
|
-
setQuantity
|
|
97
|
-
setRevenueType
|
|
98
|
-
setCurrency
|
|
99
|
-
setRevenue
|
|
100
|
-
setReceipt
|
|
101
|
-
setReceiptSig
|
|
102
|
-
setEventProperties
|
|
93
|
+
setProductId(id: string): RevenueInstance;
|
|
94
|
+
setPrice(price: number): RevenueInstance;
|
|
95
|
+
setQuantity(quantity: number): RevenueInstance;
|
|
96
|
+
setRevenueType(type: string): RevenueInstance;
|
|
97
|
+
setCurrency(currency: string): RevenueInstance;
|
|
98
|
+
setRevenue(revenue: number): RevenueInstance;
|
|
99
|
+
setReceipt(receipt: string): RevenueInstance;
|
|
100
|
+
setReceiptSig(signature: string): RevenueInstance;
|
|
101
|
+
setEventProperties(properties: Record<string, unknown>): RevenueInstance;
|
|
103
102
|
}
|
|
104
103
|
/**
|
|
105
104
|
* Env — optional SDK override. Production leaves this undefined and the
|
|
@@ -120,7 +119,8 @@ type Rules = Mapping$1.Rules<Rule>;
|
|
|
120
119
|
|
|
121
120
|
type index_AmplitudeBrowserOptions = AmplitudeBrowserOptions;
|
|
122
121
|
type index_AmplitudeDestination = AmplitudeDestination;
|
|
123
|
-
type
|
|
122
|
+
type index_AmplitudePlugin = AmplitudePlugin;
|
|
123
|
+
type index_AmplitudeSDK<I extends IdentifyInstance = IdentifyInstance, R extends RevenueInstance = RevenueInstance> = AmplitudeSDK<I, R>;
|
|
124
124
|
type index_Config = Config;
|
|
125
125
|
type index_Destination = Destination;
|
|
126
126
|
type index_Env = Env;
|
|
@@ -134,7 +134,7 @@ type index_RuntimeState = RuntimeState;
|
|
|
134
134
|
type index_Settings = Settings;
|
|
135
135
|
type index_Types = Types;
|
|
136
136
|
declare namespace index {
|
|
137
|
-
export type { index_AmplitudeBrowserOptions as AmplitudeBrowserOptions, index_AmplitudeDestination as AmplitudeDestination, index_AmplitudeSDK as AmplitudeSDK, index_Config as Config, index_Destination as Destination, index_Env as Env, index_IdentifyInstance as IdentifyInstance, index_InitSettings as InitSettings, index_Mapping as Mapping, index_RevenueInstance as RevenueInstance, index_Rule as Rule, index_Rules as Rules, index_RuntimeState as RuntimeState, index_Settings as Settings, index_Types as Types };
|
|
137
|
+
export type { index_AmplitudeBrowserOptions as AmplitudeBrowserOptions, index_AmplitudeDestination as AmplitudeDestination, index_AmplitudePlugin as AmplitudePlugin, index_AmplitudeSDK as AmplitudeSDK, index_Config as Config, index_Destination as Destination, index_Env as Env, index_IdentifyInstance as IdentifyInstance, index_InitSettings as InitSettings, index_Mapping as Mapping, index_RevenueInstance as RevenueInstance, index_Rule as Rule, index_Rules as Rules, index_RuntimeState as RuntimeState, index_Settings as Settings, index_Types as Types };
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
declare const destinationAmplitude: Destination;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { InitOptions } from '@amplitude/engagement-browser';
|
|
|
7
7
|
|
|
8
8
|
type BrowserOptions = Omit<Types$1.BrowserOptions, 'identify'>;
|
|
9
9
|
type AmplitudeBrowserOptions = Types$1.BrowserOptions;
|
|
10
|
+
type AmplitudePlugin = Types$1.Plugin;
|
|
10
11
|
/**
|
|
11
12
|
* Destination-level settings.
|
|
12
13
|
*
|
|
@@ -51,55 +52,53 @@ interface Mapping {
|
|
|
51
52
|
reset?: Mapping$1.Value | boolean;
|
|
52
53
|
}
|
|
53
54
|
/**
|
|
54
|
-
* Amplitude SDK surface
|
|
55
|
-
* destination actually uses. Mirrors the real
|
|
56
|
-
*
|
|
55
|
+
* Amplitude SDK surface: the subset of @amplitude/unified the
|
|
56
|
+
* destination actually uses. Mirrors the real client's methods so tests can
|
|
57
|
+
* mock each one via env.amplitude. Generic over the Identify and Revenue
|
|
58
|
+
* instances, so the real SDK gets back the instances it created.
|
|
57
59
|
*/
|
|
58
|
-
interface AmplitudeSDK {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
};
|
|
76
|
-
Identify: new () => IdentifyInstance;
|
|
77
|
-
Revenue: new () => RevenueInstance;
|
|
60
|
+
interface AmplitudeSDK<I extends IdentifyInstance = IdentifyInstance, R extends RevenueInstance = RevenueInstance> {
|
|
61
|
+
/** Analytics. */
|
|
62
|
+
init: (apiKey: string, options?: AmplitudeBrowserOptions) => unknown;
|
|
63
|
+
/** One plugin: Session Replay, Experiment or Guides & Surveys. */
|
|
64
|
+
add: (plugin: AmplitudePlugin) => unknown;
|
|
65
|
+
track: (eventType: string, eventProperties?: Record<string, unknown>) => unknown;
|
|
66
|
+
identify: (identify: I) => unknown;
|
|
67
|
+
revenue: (revenue: R) => unknown;
|
|
68
|
+
reset: () => unknown;
|
|
69
|
+
setOptOut: (optOut: boolean) => unknown;
|
|
70
|
+
setUserId: (userId: string | undefined) => unknown;
|
|
71
|
+
setDeviceId: (deviceId: string) => unknown;
|
|
72
|
+
setSessionId: (sessionId: number) => unknown;
|
|
73
|
+
setGroup: (groupType: string, groupName: string | string[]) => unknown;
|
|
74
|
+
groupIdentify: (groupType: string, groupName: string, identify: I) => unknown;
|
|
75
|
+
Identify: new () => I;
|
|
76
|
+
Revenue: new () => R;
|
|
78
77
|
}
|
|
79
|
-
/** Chainable Identify
|
|
78
|
+
/** Chainable Identify, as the @amplitude/unified Identify class. */
|
|
80
79
|
interface IdentifyInstance {
|
|
81
|
-
set
|
|
82
|
-
setOnce
|
|
83
|
-
add
|
|
84
|
-
append
|
|
85
|
-
prepend
|
|
86
|
-
preInsert
|
|
87
|
-
postInsert
|
|
88
|
-
remove
|
|
89
|
-
unset
|
|
90
|
-
clearAll
|
|
80
|
+
set(property: string, value: unknown): IdentifyInstance;
|
|
81
|
+
setOnce(property: string, value: unknown): IdentifyInstance;
|
|
82
|
+
add(property: string, value: number): IdentifyInstance;
|
|
83
|
+
append(property: string, value: unknown): IdentifyInstance;
|
|
84
|
+
prepend(property: string, value: unknown): IdentifyInstance;
|
|
85
|
+
preInsert(property: string, value: unknown): IdentifyInstance;
|
|
86
|
+
postInsert(property: string, value: unknown): IdentifyInstance;
|
|
87
|
+
remove(property: string, value: unknown): IdentifyInstance;
|
|
88
|
+
unset(property: string): IdentifyInstance;
|
|
89
|
+
clearAll(): IdentifyInstance;
|
|
91
90
|
}
|
|
92
|
-
/** Chainable Revenue
|
|
91
|
+
/** Chainable Revenue, as the @amplitude/unified Revenue class. */
|
|
93
92
|
interface RevenueInstance {
|
|
94
|
-
setProductId
|
|
95
|
-
setPrice
|
|
96
|
-
setQuantity
|
|
97
|
-
setRevenueType
|
|
98
|
-
setCurrency
|
|
99
|
-
setRevenue
|
|
100
|
-
setReceipt
|
|
101
|
-
setReceiptSig
|
|
102
|
-
setEventProperties
|
|
93
|
+
setProductId(id: string): RevenueInstance;
|
|
94
|
+
setPrice(price: number): RevenueInstance;
|
|
95
|
+
setQuantity(quantity: number): RevenueInstance;
|
|
96
|
+
setRevenueType(type: string): RevenueInstance;
|
|
97
|
+
setCurrency(currency: string): RevenueInstance;
|
|
98
|
+
setRevenue(revenue: number): RevenueInstance;
|
|
99
|
+
setReceipt(receipt: string): RevenueInstance;
|
|
100
|
+
setReceiptSig(signature: string): RevenueInstance;
|
|
101
|
+
setEventProperties(properties: Record<string, unknown>): RevenueInstance;
|
|
103
102
|
}
|
|
104
103
|
/**
|
|
105
104
|
* Env — optional SDK override. Production leaves this undefined and the
|
|
@@ -120,7 +119,8 @@ type Rules = Mapping$1.Rules<Rule>;
|
|
|
120
119
|
|
|
121
120
|
type index_AmplitudeBrowserOptions = AmplitudeBrowserOptions;
|
|
122
121
|
type index_AmplitudeDestination = AmplitudeDestination;
|
|
123
|
-
type
|
|
122
|
+
type index_AmplitudePlugin = AmplitudePlugin;
|
|
123
|
+
type index_AmplitudeSDK<I extends IdentifyInstance = IdentifyInstance, R extends RevenueInstance = RevenueInstance> = AmplitudeSDK<I, R>;
|
|
124
124
|
type index_Config = Config;
|
|
125
125
|
type index_Destination = Destination;
|
|
126
126
|
type index_Env = Env;
|
|
@@ -134,7 +134,7 @@ type index_RuntimeState = RuntimeState;
|
|
|
134
134
|
type index_Settings = Settings;
|
|
135
135
|
type index_Types = Types;
|
|
136
136
|
declare namespace index {
|
|
137
|
-
export type { index_AmplitudeBrowserOptions as AmplitudeBrowserOptions, index_AmplitudeDestination as AmplitudeDestination, index_AmplitudeSDK as AmplitudeSDK, index_Config as Config, index_Destination as Destination, index_Env as Env, index_IdentifyInstance as IdentifyInstance, index_InitSettings as InitSettings, index_Mapping as Mapping, index_RevenueInstance as RevenueInstance, index_Rule as Rule, index_Rules as Rules, index_RuntimeState as RuntimeState, index_Settings as Settings, index_Types as Types };
|
|
137
|
+
export type { index_AmplitudeBrowserOptions as AmplitudeBrowserOptions, index_AmplitudeDestination as AmplitudeDestination, index_AmplitudePlugin as AmplitudePlugin, index_AmplitudeSDK as AmplitudeSDK, index_Config as Config, index_Destination as Destination, index_Env as Env, index_IdentifyInstance as IdentifyInstance, index_InitSettings as InitSettings, index_Mapping as Mapping, index_RevenueInstance as RevenueInstance, index_Rule as Rule, index_Rules as Rules, index_RuntimeState as RuntimeState, index_Settings as Settings, index_Types as Types };
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
declare const destinationAmplitude: Destination;
|