@metamask-previews/analytics-controller 2.0.0-preview-3866c0ff1 → 2.0.0-preview-e3275932a
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 +0 -4
- package/dist/AnalyticsController-method-action-types.cjs +7 -0
- package/dist/AnalyticsController-method-action-types.cjs.map +1 -0
- package/dist/{AnalyticsController-method-action-types.d.ts → AnalyticsController-method-action-types.d.cts} +2 -2
- package/dist/AnalyticsController-method-action-types.d.cts.map +1 -0
- package/dist/AnalyticsController-method-action-types.d.mts +81 -0
- package/dist/AnalyticsController-method-action-types.d.mts.map +1 -0
- package/dist/{AnalyticsController-method-action-types.js → AnalyticsController-method-action-types.mjs} +1 -1
- package/dist/AnalyticsController-method-action-types.mjs.map +1 -0
- package/dist/AnalyticsController.cjs +641 -0
- package/dist/AnalyticsController.cjs.map +1 -0
- package/dist/{AnalyticsController.d.ts → AnalyticsController.d.cts} +8 -8
- package/dist/AnalyticsController.d.cts.map +1 -0
- package/dist/AnalyticsController.d.mts +312 -0
- package/dist/AnalyticsController.d.mts.map +1 -0
- package/dist/AnalyticsController.mjs +637 -0
- package/dist/AnalyticsController.mjs.map +1 -0
- package/dist/AnalyticsLogger.cjs +8 -0
- package/dist/AnalyticsLogger.cjs.map +1 -0
- package/dist/AnalyticsLogger.d.cts +5 -0
- package/dist/AnalyticsLogger.d.cts.map +1 -0
- package/dist/AnalyticsLogger.d.mts +5 -0
- package/dist/AnalyticsLogger.d.mts.map +1 -0
- package/dist/{AnalyticsLogger.js → AnalyticsLogger.mjs} +2 -2
- package/dist/AnalyticsLogger.mjs.map +1 -0
- package/dist/AnalyticsPlatformAdapter.types.cjs +3 -0
- package/dist/AnalyticsPlatformAdapter.types.cjs.map +1 -0
- package/dist/{AnalyticsPlatformAdapter.types.d.ts → AnalyticsPlatformAdapter.types.d.cts} +2 -2
- package/dist/AnalyticsPlatformAdapter.types.d.cts.map +1 -0
- package/dist/AnalyticsPlatformAdapter.types.d.mts +144 -0
- package/dist/AnalyticsPlatformAdapter.types.d.mts.map +1 -0
- package/dist/AnalyticsPlatformAdapter.types.mjs +2 -0
- package/dist/AnalyticsPlatformAdapter.types.mjs.map +1 -0
- package/dist/AnalyticsPlatformAdapterSetupError.cjs +17 -0
- package/dist/AnalyticsPlatformAdapterSetupError.cjs.map +1 -0
- package/dist/{AnalyticsPlatformAdapterSetupError.d.ts → AnalyticsPlatformAdapterSetupError.d.cts} +1 -1
- package/dist/AnalyticsPlatformAdapterSetupError.d.cts.map +1 -0
- package/dist/AnalyticsPlatformAdapterSetupError.d.mts +8 -0
- package/dist/AnalyticsPlatformAdapterSetupError.d.mts.map +1 -0
- package/dist/{AnalyticsPlatformAdapterSetupError.js → AnalyticsPlatformAdapterSetupError.mjs} +1 -2
- package/dist/AnalyticsPlatformAdapterSetupError.mjs.map +1 -0
- package/dist/analyticsControllerStateValidator.cjs +36 -0
- package/dist/analyticsControllerStateValidator.cjs.map +1 -0
- package/dist/{analyticsControllerStateValidator.d.ts → analyticsControllerStateValidator.d.cts} +2 -2
- package/dist/analyticsControllerStateValidator.d.cts.map +1 -0
- package/dist/analyticsControllerStateValidator.d.mts +17 -0
- package/dist/analyticsControllerStateValidator.d.mts.map +1 -0
- package/dist/{analyticsControllerStateValidator.js → analyticsControllerStateValidator.mjs} +1 -1
- package/dist/analyticsControllerStateValidator.mjs.map +1 -0
- package/dist/index.cjs +14 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{index.d.ts → index.d.cts} +10 -10
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +10 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +7 -0
- package/dist/index.mjs.map +1 -0
- package/dist/{selectors.d.ts → selectors.cjs} +13 -12
- package/dist/selectors.cjs.map +1 -0
- package/dist/selectors.d.cts +12 -0
- package/dist/selectors.d.cts.map +1 -0
- package/dist/selectors.d.mts +12 -0
- package/dist/selectors.d.mts.map +1 -0
- package/dist/{selectors.js → selectors.mjs} +1 -1
- package/dist/selectors.mjs.map +1 -0
- package/package.json +17 -13
- package/dist/AnalyticsController-method-action-types.d.ts.map +0 -1
- package/dist/AnalyticsController-method-action-types.js.map +0 -1
- package/dist/AnalyticsController.d.ts.map +0 -1
- package/dist/AnalyticsController.js +0 -746
- package/dist/AnalyticsController.js.map +0 -1
- package/dist/AnalyticsLogger.d.ts +0 -4
- package/dist/AnalyticsLogger.d.ts.map +0 -1
- package/dist/AnalyticsLogger.js.map +0 -1
- package/dist/AnalyticsPlatformAdapter.types.d.ts.map +0 -1
- package/dist/AnalyticsPlatformAdapter.types.js +0 -2
- package/dist/AnalyticsPlatformAdapter.types.js.map +0 -1
- package/dist/AnalyticsPlatformAdapterSetupError.d.ts.map +0 -1
- package/dist/AnalyticsPlatformAdapterSetupError.js.map +0 -1
- package/dist/analyticsControllerStateValidator.d.ts.map +0 -1
- package/dist/analyticsControllerStateValidator.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -7
- package/dist/index.js.map +0 -1
- package/dist/selectors.d.ts.map +0 -1
- package/dist/selectors.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,10 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
-
### Changed
|
|
11
|
-
|
|
12
|
-
- **BREAKING:** Bump minimum Node.js version to 22 ([#9168](https://github.com/MetaMask/core/pull/9168))
|
|
13
|
-
|
|
14
10
|
## [2.0.0]
|
|
15
11
|
|
|
16
12
|
### Changed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnalyticsController-method-action-types.cjs","sourceRoot":"","sources":["../src/AnalyticsController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { AnalyticsController } from './AnalyticsController.js';\n\n/**\n * Track an analytics event.\n *\n * Events are only tracked if analytics is enabled.\n *\n * @param event - Analytics event with properties and sensitive properties\n * @param context - Optional platform-specific context forwarded to the platform adapter.\n */\nexport type AnalyticsControllerTrackEventAction = {\n type: `AnalyticsController:trackEvent`;\n handler: AnalyticsController['trackEvent'];\n};\n\n/**\n * Identify a user for analytics.\n *\n * @param traits - User traits/properties\n * @param context - Optional platform-specific context forwarded to the platform adapter.\n */\nexport type AnalyticsControllerIdentifyAction = {\n type: `AnalyticsController:identify`;\n handler: AnalyticsController['identify'];\n};\n\n/**\n * Track a page or screen view.\n *\n * @param name - The identifier/name of the page or screen being viewed (e.g., \"home\", \"settings\", \"wallet\")\n * @param properties - Optional properties associated with the view\n * @param context - Optional platform-specific context forwarded to the platform adapter.\n */\nexport type AnalyticsControllerTrackViewAction = {\n type: `AnalyticsController:trackView`;\n handler: AnalyticsController['trackView'];\n};\n\n/**\n * Opt in to analytics.\n *\n * Records that a consent decision has been made and replays any events that\n * were queued while the user was undecided.\n *\n * When geolocation enrichment is enabled, geolocation is resolved here (once\n * the user has consented) and awaited before the queued events are replayed,\n * so those events are enriched with the resolved location as they are sent.\n *\n * @returns A promise that resolves once opt-in processing has completed.\n */\nexport type AnalyticsControllerOptInAction = {\n type: `AnalyticsController:optIn`;\n handler: AnalyticsController['optIn'];\n};\n\n/**\n * Opt out of analytics.\n *\n * Records that a consent decision has been made and discards any persisted\n * events so nothing captured before the decision is ever delivered.\n */\nexport type AnalyticsControllerOptOutAction = {\n type: `AnalyticsController:optOut`;\n handler: AnalyticsController['optOut'];\n};\n\n/**\n * Reset the consent decision back to undecided.\n *\n * Intended for client flows that restart onboarding. Clears the opt-in\n * preference and discards the delivery queue, but preserves any pre-consent\n * events so they can still be replayed if the user opts in again. The user is\n * treated as undecided again.\n */\nexport type AnalyticsControllerResetConsentDecisionAction = {\n type: `AnalyticsController:resetConsentDecision`;\n handler: AnalyticsController['resetConsentDecision'];\n};\n\n/**\n * Union of all AnalyticsController action types.\n */\nexport type AnalyticsControllerMethodActions =\n | AnalyticsControllerTrackEventAction\n | AnalyticsControllerIdentifyAction\n | AnalyticsControllerTrackViewAction\n | AnalyticsControllerOptInAction\n | AnalyticsControllerOptOutAction\n | AnalyticsControllerResetConsentDecisionAction;\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This file is auto generated.
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
*/
|
|
5
|
-
import type { AnalyticsController } from
|
|
5
|
+
import type { AnalyticsController } from "./AnalyticsController.cjs";
|
|
6
6
|
/**
|
|
7
7
|
* Track an analytics event.
|
|
8
8
|
*
|
|
@@ -78,4 +78,4 @@ export type AnalyticsControllerResetConsentDecisionAction = {
|
|
|
78
78
|
* Union of all AnalyticsController action types.
|
|
79
79
|
*/
|
|
80
80
|
export type AnalyticsControllerMethodActions = AnalyticsControllerTrackEventAction | AnalyticsControllerIdentifyAction | AnalyticsControllerTrackViewAction | AnalyticsControllerOptInAction | AnalyticsControllerOptOutAction | AnalyticsControllerResetConsentDecisionAction;
|
|
81
|
-
//# sourceMappingURL=AnalyticsController-method-action-types.d.
|
|
81
|
+
//# sourceMappingURL=AnalyticsController-method-action-types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnalyticsController-method-action-types.d.cts","sourceRoot":"","sources":["../src/AnalyticsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,kCAAiC;AAEpE;;;;;;;GAOG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,2BAA2B,CAAC;IAClC,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;CACvC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,4BAA4B,CAAC;IACnC,OAAO,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,6CAA6C,GAAG;IAC1D,IAAI,EAAE,0CAA0C,CAAC;IACjD,OAAO,EAAE,mBAAmB,CAAC,sBAAsB,CAAC,CAAC;CACtD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gCAAgC,GACxC,mCAAmC,GACnC,iCAAiC,GACjC,kCAAkC,GAClC,8BAA8B,GAC9B,+BAA+B,GAC/B,6CAA6C,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto generated.
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
*/
|
|
5
|
+
import type { AnalyticsController } from "./AnalyticsController.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* Track an analytics event.
|
|
8
|
+
*
|
|
9
|
+
* Events are only tracked if analytics is enabled.
|
|
10
|
+
*
|
|
11
|
+
* @param event - Analytics event with properties and sensitive properties
|
|
12
|
+
* @param context - Optional platform-specific context forwarded to the platform adapter.
|
|
13
|
+
*/
|
|
14
|
+
export type AnalyticsControllerTrackEventAction = {
|
|
15
|
+
type: `AnalyticsController:trackEvent`;
|
|
16
|
+
handler: AnalyticsController['trackEvent'];
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Identify a user for analytics.
|
|
20
|
+
*
|
|
21
|
+
* @param traits - User traits/properties
|
|
22
|
+
* @param context - Optional platform-specific context forwarded to the platform adapter.
|
|
23
|
+
*/
|
|
24
|
+
export type AnalyticsControllerIdentifyAction = {
|
|
25
|
+
type: `AnalyticsController:identify`;
|
|
26
|
+
handler: AnalyticsController['identify'];
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Track a page or screen view.
|
|
30
|
+
*
|
|
31
|
+
* @param name - The identifier/name of the page or screen being viewed (e.g., "home", "settings", "wallet")
|
|
32
|
+
* @param properties - Optional properties associated with the view
|
|
33
|
+
* @param context - Optional platform-specific context forwarded to the platform adapter.
|
|
34
|
+
*/
|
|
35
|
+
export type AnalyticsControllerTrackViewAction = {
|
|
36
|
+
type: `AnalyticsController:trackView`;
|
|
37
|
+
handler: AnalyticsController['trackView'];
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Opt in to analytics.
|
|
41
|
+
*
|
|
42
|
+
* Records that a consent decision has been made and replays any events that
|
|
43
|
+
* were queued while the user was undecided.
|
|
44
|
+
*
|
|
45
|
+
* When geolocation enrichment is enabled, geolocation is resolved here (once
|
|
46
|
+
* the user has consented) and awaited before the queued events are replayed,
|
|
47
|
+
* so those events are enriched with the resolved location as they are sent.
|
|
48
|
+
*
|
|
49
|
+
* @returns A promise that resolves once opt-in processing has completed.
|
|
50
|
+
*/
|
|
51
|
+
export type AnalyticsControllerOptInAction = {
|
|
52
|
+
type: `AnalyticsController:optIn`;
|
|
53
|
+
handler: AnalyticsController['optIn'];
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Opt out of analytics.
|
|
57
|
+
*
|
|
58
|
+
* Records that a consent decision has been made and discards any persisted
|
|
59
|
+
* events so nothing captured before the decision is ever delivered.
|
|
60
|
+
*/
|
|
61
|
+
export type AnalyticsControllerOptOutAction = {
|
|
62
|
+
type: `AnalyticsController:optOut`;
|
|
63
|
+
handler: AnalyticsController['optOut'];
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Reset the consent decision back to undecided.
|
|
67
|
+
*
|
|
68
|
+
* Intended for client flows that restart onboarding. Clears the opt-in
|
|
69
|
+
* preference and discards the delivery queue, but preserves any pre-consent
|
|
70
|
+
* events so they can still be replayed if the user opts in again. The user is
|
|
71
|
+
* treated as undecided again.
|
|
72
|
+
*/
|
|
73
|
+
export type AnalyticsControllerResetConsentDecisionAction = {
|
|
74
|
+
type: `AnalyticsController:resetConsentDecision`;
|
|
75
|
+
handler: AnalyticsController['resetConsentDecision'];
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Union of all AnalyticsController action types.
|
|
79
|
+
*/
|
|
80
|
+
export type AnalyticsControllerMethodActions = AnalyticsControllerTrackEventAction | AnalyticsControllerIdentifyAction | AnalyticsControllerTrackViewAction | AnalyticsControllerOptInAction | AnalyticsControllerOptOutAction | AnalyticsControllerResetConsentDecisionAction;
|
|
81
|
+
//# sourceMappingURL=AnalyticsController-method-action-types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnalyticsController-method-action-types.d.mts","sourceRoot":"","sources":["../src/AnalyticsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,kCAAiC;AAEpE;;;;;;;GAOG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,2BAA2B,CAAC;IAClC,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;CACvC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,4BAA4B,CAAC;IACnC,OAAO,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,6CAA6C,GAAG;IAC1D,IAAI,EAAE,0CAA0C,CAAC;IACjD,OAAO,EAAE,mBAAmB,CAAC,sBAAsB,CAAC,CAAC;CACtD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gCAAgC,GACxC,mCAAmC,GACnC,iCAAiC,GACjC,kCAAkC,GAClC,8BAA8B,GAC9B,+BAA+B,GAC/B,6CAA6C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnalyticsController-method-action-types.mjs","sourceRoot":"","sources":["../src/AnalyticsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { AnalyticsController } from './AnalyticsController.js';\n\n/**\n * Track an analytics event.\n *\n * Events are only tracked if analytics is enabled.\n *\n * @param event - Analytics event with properties and sensitive properties\n * @param context - Optional platform-specific context forwarded to the platform adapter.\n */\nexport type AnalyticsControllerTrackEventAction = {\n type: `AnalyticsController:trackEvent`;\n handler: AnalyticsController['trackEvent'];\n};\n\n/**\n * Identify a user for analytics.\n *\n * @param traits - User traits/properties\n * @param context - Optional platform-specific context forwarded to the platform adapter.\n */\nexport type AnalyticsControllerIdentifyAction = {\n type: `AnalyticsController:identify`;\n handler: AnalyticsController['identify'];\n};\n\n/**\n * Track a page or screen view.\n *\n * @param name - The identifier/name of the page or screen being viewed (e.g., \"home\", \"settings\", \"wallet\")\n * @param properties - Optional properties associated with the view\n * @param context - Optional platform-specific context forwarded to the platform adapter.\n */\nexport type AnalyticsControllerTrackViewAction = {\n type: `AnalyticsController:trackView`;\n handler: AnalyticsController['trackView'];\n};\n\n/**\n * Opt in to analytics.\n *\n * Records that a consent decision has been made and replays any events that\n * were queued while the user was undecided.\n *\n * When geolocation enrichment is enabled, geolocation is resolved here (once\n * the user has consented) and awaited before the queued events are replayed,\n * so those events are enriched with the resolved location as they are sent.\n *\n * @returns A promise that resolves once opt-in processing has completed.\n */\nexport type AnalyticsControllerOptInAction = {\n type: `AnalyticsController:optIn`;\n handler: AnalyticsController['optIn'];\n};\n\n/**\n * Opt out of analytics.\n *\n * Records that a consent decision has been made and discards any persisted\n * events so nothing captured before the decision is ever delivered.\n */\nexport type AnalyticsControllerOptOutAction = {\n type: `AnalyticsController:optOut`;\n handler: AnalyticsController['optOut'];\n};\n\n/**\n * Reset the consent decision back to undecided.\n *\n * Intended for client flows that restart onboarding. Clears the opt-in\n * preference and discards the delivery queue, but preserves any pre-consent\n * events so they can still be replayed if the user opts in again. The user is\n * treated as undecided again.\n */\nexport type AnalyticsControllerResetConsentDecisionAction = {\n type: `AnalyticsController:resetConsentDecision`;\n handler: AnalyticsController['resetConsentDecision'];\n};\n\n/**\n * Union of all AnalyticsController action types.\n */\nexport type AnalyticsControllerMethodActions =\n | AnalyticsControllerTrackEventAction\n | AnalyticsControllerIdentifyAction\n | AnalyticsControllerTrackViewAction\n | AnalyticsControllerOptInAction\n | AnalyticsControllerOptOutAction\n | AnalyticsControllerResetConsentDecisionAction;\n"]}
|